diff --git a/README.md b/README.md index 46cd425..2a78e4d 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,14 @@ The Nix bits are driven by `flake.nix` which pulls in things under `modules/`. B - all the outputs from the inputs - a `let` ... `in` block that contains: - `darwinHostConfig` which takes a set of paramters as an attribute set and pulls in all the things needed to use Nix on a macOS host - - `nixosHostConfig` which takes a set of parameters as an attribute set and pulls in all the things needed to configure a NixOS host + - `mkNixosHost` which takes a set of parameters as an attribute set and pulls in all the things needed to configure a NixOS host - `linuxHomeConfig` which takes a set of paramters as an attribute set and pulls in the things I manage on non-NixOS Linux hosts - the body of outputs that contains: - `darwinConfigurations` contains is an attribute set that contains keys named for each macOS host set to the results of a call to `darwinHostConfig` with values for each of the required parameters - `nixosConfigurations` contains is an attribute set that contains keys named for each NixOS host set to the results of a call to `darwinHostConfig` with values for each of the required parameters - `homeConfigurations` contains an entry for each username set to the results of a call to `linuxHomeConfig` with values for each of the required parameters -The parameters on `darwinHostConfig` & `nixosHostConfig` are: +The parameters on `darwinHostConfig` & `mkNixosHost` are: - `system:` the system definition to use for nixpkgs - `hostname:` the hostname of the machine being configured diff --git a/examples/flake-structure.nix b/examples/flake-structure.nix index a24ec94..b47d1a5 100644 --- a/examples/flake-structure.nix +++ b/examples/flake-structure.nix @@ -4,7 +4,7 @@ darwinHostConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: nix-darwin.lib.darwinSystem { }; - nixosHostConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: + mkNixosHost = { system, hostname, username, additionalModules, additionalSpecialArgs }: nixpkgs.lib.nixosSystem { }; linuxHomeConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: @@ -24,7 +24,7 @@ # NixOS hosts nixosConfigurations = { - rainbow-planet = nixosHostConfig { + rainbow-planet = mkNixosHost { system = "x86_64-linux"; hostname = "rainbow-planet"; username = "gene"; diff --git a/flake.nix b/flake.nix index 082e777..47a2d76 100644 --- a/flake.nix +++ b/flake.nix @@ -170,38 +170,38 @@ # NixOS hosts nixosConfigurations = { - bigboy = mylib.nixosHostConfig { + bigboy = mylib.mkNixosHost { hostname = "bigboy"; additionalModules = [ nixos-hardware.nixosModules.lenovo-thinkpad-p52 ]; }; - hetznix01 = mylib.nixosHostConfig { + hetznix01 = mylib.mkNixosHost { hostname = "hetznix01"; additionalModules = [ simple-nixos-mailserver.nixosModule ]; }; - hetznix02 = mylib.nixosHostConfig { + hetznix02 = mylib.mkNixosHost { system = "aarch64-linux"; hostname = "hetznix02"; additionalModules = [ # simple-nixos-mailserver.nixosModule ]; }; - nixnas1 = mylib.nixosHostConfig { + nixnas1 = mylib.mkNixosHost { hostname = "nixnas1"; additionalModules = [ simple-nixos-mailserver.nixosModule ]; }; - nixnuc = mylib.nixosHostConfig { + nixnuc = mylib.mkNixosHost { hostname = "nixnuc"; additionalModules = [ simple-nixos-mailserver.nixosModule ]; }; - rainbow-planet = mylib.nixosHostConfig { + rainbow-planet = mylib.mkNixosHost { hostname = "rainbow-planet"; additionalModules = [ nixos-cosmic.nixosModules.default diff --git a/lib/default.nix b/lib/default.nix index dcf0c2b..ad532ba 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,7 @@ { inputs, ... }: let - nixosHostConfig = import ./nixosHostConfig.nix { inherit inputs; }; + mkNixosHost = import ./mkNixosHost.nix { inherit inputs; }; in { - inherit (nixosHostConfig) - nixosHostConfig + inherit (mkNixosHost) + mkNixosHost ; } \ No newline at end of file diff --git a/lib/nixosHostConfig.nix b/lib/mkNixosHost.nix similarity index 97% rename from lib/nixosHostConfig.nix rename to lib/mkNixosHost.nix index d681f1e..4cde129 100644 --- a/lib/nixosHostConfig.nix +++ b/lib/mkNixosHost.nix @@ -1,5 +1,5 @@ { inputs, ... }: { - nixosHostConfig = { + mkNixosHost = { system ? "x86_64-linux", hostname, username ? "gene",