An arguably better idea is to use an already existing 'EnsDb` which should contain pretty much the same content, and doesn't require you to duplicate already expended effort.
> library(AnnotationHub)
> hub <- AnnotationHub()
|======================================================================| 100%
snapshotDate(): 2019-10-29
> z <- query(hub, c("musculus","ensdb"))
> z
AnnotationHub with 12 records
# snapshotDate(): 2019-10-29
# $dataprovider: Ensembl
# $species: Mus musculus
# $rdataclass: EnsDb
# additional mcols(): taxonomyid, genome, description,
# coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
# rdatapath, sourceurl, sourcetype
# retrieve records with, e.g., 'object[["AH53222"]]'
title
AH53222 | Ensembl 87 EnsDb for Mus Musculus
AH53726 | Ensembl 88 EnsDb for Mus Musculus
AH56691 | Ensembl 89 EnsDb for Mus Musculus
AH57770 | Ensembl 90 EnsDb for Mus Musculus
AH60788 | Ensembl 91 EnsDb for Mus Musculus
... ...
AH64944 | Ensembl 94 EnsDb for Mus musculus
AH67971 | Ensembl 95 EnsDb for Mus musculus
AH69210 | Ensembl 96 EnsDb for Mus musculus
AH73905 | Ensembl 97 EnsDb for Mus musculus
AH75036 | Ensembl 98 EnsDb for Mus musculus
## and if you are dead set on a TxDb with Ensembl IDs
> zz <- query(hub, c("musculus","txdb"))
> zz
AnnotationHub with 6 records
# snapshotDate(): 2019-10-29
# $dataprovider: UCSC
# $species: Mus musculus
# $rdataclass: TxDb
# additional mcols(): taxonomyid, genome, description,
# coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
# rdatapath, sourceurl, sourcetype
# retrieve records with, e.g., 'object[["AH52263"]]'
title
AH52263 | TxDb.Mmusculus.UCSC.mm10.ensGene.sqlite
AH52264 | TxDb.Mmusculus.UCSC.mm10.knownGene.sqlite
AH52265 | TxDb.Mmusculus.UCSC.mm9.knownGene.sqlite
AH66175 | TxDb.Mmusculus.UCSC.mm10.knownGene.sqlite
AH70594 | TxDb.Mmusculus.UCSC.mm10.knownGene.sqlite
AH75762 | TxDb.Mmusculus.UCSC.mm10.knownGene.sqlite
## you could use the TxDb based on the ensGene table from UCSC