Rename nixosHostConfig to mkNixosHost

This commit is contained in:
Gene Liverman 2024-12-04 21:49:04 -05:00
parent 9715c97ac6
commit ce4262d2e2
5 changed files with 14 additions and 14 deletions

View file

@ -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

View file

@ -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";

View file

@ -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

View file

@ -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
;
}

View file

@ -1,5 +1,5 @@
{ inputs, ... }: {
nixosHostConfig = {
mkNixosHost = {
system ? "x86_64-linux",
hostname,
username ? "gene",