diff --git a/flake.nix b/flake.nix index a05c4af..4fb02b8 100644 --- a/flake.nix +++ b/flake.nix @@ -55,7 +55,7 @@ { nixosConfigurations = let - modules = system: with inputs; [ + modules = system: hostname: with inputs; [ ./common simple-nixos-mailserver.nixosModule agenix.nixosModules.default @@ -63,9 +63,13 @@ archivebox.nixosModule nix-index-database.nixosModules.nix-index ({ lib, ... }: { - config.environment.systemPackages = [ - agenix.packages.${system}.agenix - ]; + config = { + environment.systemPackages = [ + agenix.packages.${system}.agenix + ]; + + networking.hostName = hostname; + }; # because nixos specialArgs doesn't work for containers... need to pass in inputs a different way options.inputs = lib.mkOption { default = inputs; }; @@ -73,9 +77,9 @@ }) ]; - mkSystem = system: nixpkgs: path: + mkSystem = system: nixpkgs: path: hostname: let - allModules = modules system; + allModules = modules system hostname; # allow patching nixpkgs, remove this hack once this is solved: https://github.com/NixOS/nix/issues/3920 patchedNixpkgsSrc = nixpkgs.legacyPackages.${system}.applyPatches { @@ -99,7 +103,7 @@ in nixpkgs.lib.mapAttrs (hostname: cfg: - mkSystem cfg.arch nixpkgs cfg.configurationPath) + mkSystem cfg.arch nixpkgs cfg.configurationPath hostname) machines; packages = diff --git a/machines/phil/default.nix b/machines/phil/default.nix index 5cc61c7..592623d 100644 --- a/machines/phil/default.nix +++ b/machines/phil/default.nix @@ -5,7 +5,6 @@ ./hardware-configuration.nix ]; - networking.hostName = "phil"; services.gitea-runner = { enable = true; instanceUrl = "https://git.neet.dev"; diff --git a/machines/ponyo/default.nix b/machines/ponyo/default.nix index 60871ed..4e269d9 100644 --- a/machines/ponyo/default.nix +++ b/machines/ponyo/default.nix @@ -5,8 +5,6 @@ ./hardware-configuration.nix ]; - networking.hostName = "ponyo"; - system.autoUpgrade.enable = true; # p2p mesh network diff --git a/machines/ray/default.nix b/machines/ray/default.nix index 585e602..d951e89 100644 --- a/machines/ray/default.nix +++ b/machines/ray/default.nix @@ -5,8 +5,6 @@ ./hardware-configuration.nix ]; - networking.hostName = "ray"; - # for luks onlock over tor services.tor.enable = true; services.tor.client.enable = true; diff --git a/machines/router/default.nix b/machines/router/default.nix index 7c94de0..25e31d4 100644 --- a/machines/router/default.nix +++ b/machines/router/default.nix @@ -11,8 +11,6 @@ # https://github.com/skogsbrus/os/blob/master/sys/router.nix # http://trac.gateworks.com/wiki/wireless/wifi - networking.hostName = "router"; - system.autoUpgrade.enable = true; services.tailscale.exitNode = true; diff --git a/machines/storage/s0/default.nix b/machines/storage/s0/default.nix index 024768e..a2ac572 100644 --- a/machines/storage/s0/default.nix +++ b/machines/storage/s0/default.nix @@ -5,8 +5,6 @@ ./hardware-configuration.nix ]; - networking.hostName = "s0"; - system.autoUpgrade.enable = true; services.iperf3.enable = true;