From 38dcce1b43cd7d0992a5ef08dace3e4a225141b2 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Wed, 13 Dec 2023 09:01:52 -0500 Subject: [PATCH] Fix some typos --- README.md | 8 ++++---- docs/book/contributing.md | 2 +- docs/book/usage.md | 16 ++++++++-------- docs/modules.md | 2 +- modules/extraConfig.nix | 2 +- modules/nixos.nix | 4 ++-- modules/records.nix | 8 ++++---- utils/generate.nix | 2 +- utils/octodns.nix | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 00a4e27..f0ce784 100644 --- a/README.md +++ b/README.md @@ -30,14 +30,14 @@ I started using octodns as dns deployment tool some time ago which works like a But it bothered me that every time I wrote a new service config, I had to not just go and define the domain in the module but also in the octodns config. Which got particularly annoying because of context switches between nix and yaml. But not just that, it also prevented me from using nix's awesome versatility when it comes to dns, -for example I have a `prometheus-node-exporter.nix` which get's imported by every server in my flake, +for example I have a `prometheus-node-exporter.nix` which gets imported by every server in my flake, and has a let binding at the top defining: ```nix domain = "${config.networking.hostName}.prometheus.${config.networking.domain}"; ``` which automatically generates a domain like `myHost1.prometheus.example.com` for every server that imports it. -There is just a small problem I now also have to add a entry for every host to my octodns config, which also makes the nixos module less portable. -So I had the idea of writing a NixOS module that provides domain meta data per host and per module, to automagically generate dns entrys from. +There is just a small problem: I now also have to add a entry for every host to my octodns config, which also makes the nixos module less portable. +So I had the idea of writing a NixOS module that provides domain meta data per host and per module, to automagically generate dns entries from. Which ended up as `networking.domains.baseDomains` and `networking.domains.subDomains`. The idea is that you use `baseDomains` on a per host basis which will -define the default value for every subDomain that matches a baseDomain. +define the default value for every subDomain that matches a baseDomain, and then use `subDomains` in your modules. diff --git a/docs/book/contributing.md b/docs/book/contributing.md index 799ec51..74e3d8d 100644 --- a/docs/book/contributing.md +++ b/docs/book/contributing.md @@ -17,7 +17,7 @@ all of these are in the projects nix devshell so just run `nix develop` or `dire Uses the same module system as nixpkgs. Documentation builds fail if any description field is empty, so be sure to add one. -If a default module value is not a primary data type but tries to evalute a function add the defaultText string, +If a default module value is not a primary data type but tries to evaluate a function add the defaultText string, otherwise documentation builds will fail. Please document breaking changes in the `CHANGELOG.md` diff --git a/docs/book/usage.md b/docs/book/usage.md index 6492868..20bf4ff 100644 --- a/docs/book/usage.md +++ b/docs/book/usage.md @@ -11,7 +11,7 @@ This would probably be a easy contribution if you are more familiar. ```nix { - # You off course have to add the `nixos-dns` input like: + # You of course have to add the `nixos-dns` input like: inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixos-dns.url = "github:Janik-Haag/nixos-dns"; @@ -24,7 +24,7 @@ This would probably be a easy contribution if you are more familiar. nixpkgs, nixos-dns }: let - # You probably know this but flake outputs are architecture depended, + # You probably know this but flake outputs are architecture dependent, # so we use this little helper function. Many people use `github:numtide/flake-utils` for that. forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]; in { @@ -61,7 +61,7 @@ This would probably be a easy contribution if you are more familiar. ## NixOS Module -NixOS-DNS was built to decouple modules even more from there host. +NixOS-DNS was built to decouple modules even more from their host. To achieve this we have the concept of `baseDomains` and `subDomains`. In a nixos hosts configuration you would do something like: @@ -85,7 +85,7 @@ You might notice the `.data` behind any record, this is because you might want t As you can see above the `.ttl` isn't specifically added to every record, this is because there is `networking.domains.defaultTTL` So every `record` has two fields `ttl` and `data`, the data type differs based on the record, for more info please refer to the module docs. -And Inside of a module you would do something like: +And inside of a module you would do something like: ```nix networking.domains.subDomains."grafana.example.com" = { }; ``` @@ -110,7 +110,7 @@ So this would produce this set: > **note** > -> baseDomains and there records don't end up in zone files, octodns configs, or any other output for that matter +> baseDomains and their records don't end up in zone files, octodns configs, or any other output for that matter > So in the example above for "example.com" to end up in a zone file you would have to add: > ```nix > networking.domains.subDomains."example.com" = { }; @@ -124,7 +124,7 @@ Nix supports `${}` operations inside of attrsets, so you can get creative and do networking.domains.subDomains."${networking.hostname}.prometheus.example.com" = { }; ``` -NixOS-DNS does a bunch of magic to automatically map subDomains to there closest baseDomain and throws an error if there is no matching baseDomain. +NixOS-DNS does a bunch of magic to automatically map subDomains to their closest baseDomain and throws an error if there is no matching baseDomain. So if we have: ```nix networking.domains.baseDomains = { @@ -158,8 +158,8 @@ And `example.net` just wouldn't get matched, but that's fine since it is a baseD You probably want to add some more information, to do so you can use the extraConfiguration key in the dnsConfig. Please take a look at [the example](https://github.com/Janik-Haag/nixos-dns/tree/main/example/dns.nix) for usage information. -All the hosts in `nixosConfigurations` and `extraConfig` get merged and nothing get's overwritten. -So if you define multiple domains with the same records all the record data get's merged. +All the hosts in `nixosConfigurations` and `extraConfig` get merged and nothing gets overwritten. +So if you define multiple domains with the same records all the record data gets merged. ## octodns diff --git a/docs/modules.md b/docs/modules.md index d2e5a66..5235cfa 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -3,5 +3,5 @@ There is a module for NixOS and a module for extraConfig. They both take the same record values and have the same assertions. Please take a look at the coming pages for a list of available options. -I currently have trouble rendering the record fields if there type is a sub module, +I currently have trouble rendering the record fields if their type is a sub module, if you are interested in any like caa or mx, you'll sadly have to take a look at [the source](https://github.com/Janik-Haag/NixOS-DNS/tree/main/modules/records.nix) for now. diff --git a/modules/extraConfig.nix b/modules/extraConfig.nix index 38482ad..55b08ff 100644 --- a/modules/extraConfig.nix +++ b/modules/extraConfig.nix @@ -5,7 +5,7 @@ zones = lib.mkOption { default = { }; description = lib.mdDoc '' - Takes in a attrset of domain apex and there entries. + Takes in a attrset of domain apex and their entries. ''; apply = x: lib.filterAttrsRecursive (n: v: diff --git a/modules/nixos.nix b/modules/nixos.nix index bfddd70..a79c51a 100644 --- a/modules/nixos.nix +++ b/modules/nixos.nix @@ -24,7 +24,7 @@ in }; subDomains = lib.mkOption { description = lib.mdDoc '' - Attribute set of subdomains that inherit values from there matching domain. + Attribute set of subdomains that inherit values from their matching domain. ''; default = { }; apply = lib.filterAttrsRecursive (n: v: @@ -64,7 +64,7 @@ in { assertion = true; message = '' - Alais assertion, same as CNAME but a alias is allowed as zone apex + Alias assertion, same as CNAME but a alias is allowed as zone apex ''; } { diff --git a/modules/records.nix b/modules/records.nix index 31732a7..c84faa7 100644 --- a/modules/records.nix +++ b/modules/records.nix @@ -51,14 +51,14 @@ lib.mapAttrs { a.common = { description = lib.mdDoc '' - Commonly used to map a name to a list of IPv4 address's. + Commonly used to map a name to a list of IPv4 addresses. ''; example = "9.9.9.9"; type = with lib.types; nullOr (coercedTo str (f: [ f ]) (listOf str)); # change me to lib.types.ipv4 once it exists }; aaaa.common = { description = lib.mdDoc '' - Commonly used to map a name to a list of IPv6 address's. + Commonly used to map a name to a list of IPv6 addresses. ''; example = "2620:fe::fe"; type = with lib.types; nullOr (coercedTo str (f: [ f ]) (listOf str)); # change me to lib.types.ipv6 once it exists @@ -136,7 +136,7 @@ lib.mapAttrs dname = { common = { description = lib.mdDoc '' - Same as cname but also get's applied to any subdomain of the given domain + Same as cname but also gets applied to any subdomain of the given domain ''; example = "foo.example.com"; type = with lib.types; nullOr str; # change str to lib.types.domain once it exists @@ -209,7 +209,7 @@ lib.mapAttrs }; serial = lib.mkOption { description = lib.mdDoc '' - A zone serial number is a version number for the SOA record (the higher the newer). When the serial number changes in a zone file, this alerts secondary nameservers that they should update their copies of the zone file via a zone transfer. Usually most dns-utiltiltys working with zonefiles increment it automatically. + A zone serial number is a version number for the SOA record (the higher the newer). When the serial number changes in a zone file, this alerts secondary nameservers that they should update their copies of the zone file via a zone transfer. Usually most dns-utilities working with zonefiles increment it automatically. ''; example = ""; type = lib.types.int; diff --git a/utils/generate.nix b/utils/generate.nix index 6e65d60..deaa1ce 100644 --- a/utils/generate.nix +++ b/utils/generate.nix @@ -47,7 +47,7 @@ in manager = { }; } ``` - Everything except for dnsConfig is a 1:1 map of the octodns config yaml described in there docs. + Everything except for dnsConfig is a 1:1 map of the octodns config yaml described in their docs. */ octodnsConfig = # The required config diff --git a/utils/octodns.nix b/utils/octodns.nix index ce703b9..43bec39 100644 --- a/utils/octodns.nix +++ b/utils/octodns.nix @@ -6,7 +6,7 @@ It won't actually be used by anything. But the octodns bind module has a check for the validity of a zone-file and a zone-file MUST have a SOA record. - Anyways, octodns will just ignore it's existence and only sync supported records. + Anyways, octodns will just ignore its existence and only sync supported records. Type: utils.octodns.fakeSOA :: Attr -> Attr @@ -55,7 +55,7 @@ providers = { config = { class = "octodns_bind.ZoneFileSource"; - # get's overwritten at the build step + # gets overwritten at the build step directory = null; # by default the files are supposed to be called `$zone.` this makes it so it's only `$zone` file_extension = "";