commit 14d1e8c8e9b5a2cae583b0a0a08d62ec50ee9091
parent ebd86c6f70a2948d1b8f737253fa039ff76e6049
Author: Francesco Saccone <francesco@francescosaccone.com>
Date: Thu, 15 May 2025 09:41:57 +0200
fix: rename services.bind to services.dns
It led to conflict with nixpkgs services.bind, and also using
generic names such as 'dns' or 'web-server' for modules has been
in my mind for a while.
Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>
Diffstat:
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/hosts/git-server/default.nix b/hosts/git-server/default.nix
@@ -23,7 +23,7 @@ in
];
services = {
- bind = {
+ dns = {
enable = true;
domain = rootDomain;
records = import "${mainServer}/dns.nix" rootDomain;
diff --git a/hosts/main-server/default.nix b/hosts/main-server/default.nix
@@ -13,7 +13,7 @@ rec {
];
services = {
- bind = {
+ dns = {
enable = true;
inherit (networking) domain;
records = import ./dns.nix domain;
diff --git a/modules/nixos/bind/default.nix b/modules/nixos/bind/default.nix
@@ -6,9 +6,9 @@
...
}:
{
- options.services.bind = {
+ options.services.dns = {
enable = lib.mkOption {
- description = "Whether to enable BIND.";
+ description = "Whether to enable BIND DNS server.";
default = false;
type = lib.types.bool;
};
@@ -48,15 +48,15 @@
};
};
- config = lib.mkIf config.services.bind.enable {
+ config = lib.mkIf config.services.dns.enable {
services.bind = {
enable = true;
package = pkgs.bind;
- zones.${config.services.bind.domain} = {
+ zones.${config.services.dns.domain} = {
master = true;
file =
- config.services.bind.records
+ config.services.dns.records
|> builtins.map (
{
name,
@@ -66,7 +66,7 @@
data,
}:
let
- inherit (config.services.bind) domain;
+ inherit (config.services.dns) domain;
subdomain = if name != "@" then "${name}." else "";
in
[
@@ -79,7 +79,7 @@
|> builtins.concatStringsSep " "
)
|> builtins.concatStringsSep "\n"
- |> pkgs.writeText "${config.services.bind.domain}";
+ |> pkgs.writeText "${config.services.dns.domain}";
};
};