Structure
Function Arguments
name: a string representing the host name.useHomeManagerModule: whether to include the Home Manager module in the NixOS and Nix-Darwin configurations of this host. Defaults to the value ofdelib.configurations :: useHomeManagerModule, which itself defaults totrue.homeManagerUser: the username, used inhome-manager.users.${homeManagerUser}and for generating the Home Manager configuration list. Defaults todelib.configurations :: homeManagerUser.homeManagerSystem: a string used in thepkgsattribute of thehome-manager.lib.homeManagerConfigurationfunction, which is used in thedelib.configurationsfunction ashomeManagerNixpkgs.legacyPackages.${homeManagerSystem}.myconfig: sets its value toconfig.${myconfigName}ifconfig.${myconfigName}.hostmatches the current host.nixos: sets its value toconfigifmoduleSystemisnixosandconfig.${myconfigName}.hostmatches the current host.home: sets its value toconfigifmoduleSystemishomeandconfig.${myconfigName}.hostmatches the current host. Otherwise, ifconfig.${myconfigName}.hostmatches the current host, sets its value toconfig.home-manager.users.${homeManagerUser}.darwin: sets its value toconfigifmoduleSystemisdarwinandconfig.${myconfigName}.hostmatches the current host.shared.myconfig: sets its value toconfig.${myconfigName}for all hosts.shared.nixos: sets its value toconfigifmoduleSystemisnixos. Otherwise, does nothing.shared.home: sets its value toconfigifmoduleSystemishome. Otherwise, sets it toconfig.home-manager.users.${homeManagerUser}.shared.darwin: sets its value toconfigifmoduleSystemisdarwin. Otherwise, does nothing.
Passed Arguments
A list of arguments passed to ?(shared.)[myconfig|nixos|home|darwin] if their type is lambda:
name: the samenameas in the arguments ofdelib.host.myconfig: equalsconfig.${myConfigName}.cfg: equalsconfig.${myConfigName}.hosts.${delib.host :: name}.
Pseudocode
nix
delib.host {
name = "";
useHomeManagerModule = true;
homeManagerUser = "sjohn";
# homeManagerNixpkgs.legacyPackages.${homeManagerSystem}
homeManagerSystem = "x86_64-linux";
# if config.${myconfigName}.host == name
# then {config.${myConfigName} = ...;}
# else {}
myconfig = {name, cfg, myconfig, ...}: {};
# if config.${myconfigName}.host == name, then
# if moduleSystem == "nixos"
# then {config = ...;}
# else {}
# else {}
nixos = {name, cfg, myconfig, ...}: {};
# if config.${myconfigName}.host == name, then
# if moduleSystem == "home"
# then {config = ...;}
# else {config.home-manager.users.${homeManagerUser} = ...;}
# else {}
home = {name, cfg, myconfig, ...}: {};
# if config.${myconfigName}.host == name, then
# if moduleSystem == "darwin"
# then {config = ...;}
# else {}
# else {}
darwin = {name, cfg, myconfig, ...}: {};
# config.${myConfigName} = ...
shared.myconfig = {name, cfg, myconfig, ...}: {};
# if moduleSystem == "nixos"
# then {config = ...;}
# else {}
shared.nixos = {name, cfg, myconfig, ...}: {};
# if moduleSystem == "home"
# then {config = ...;}
# else {config.home-manager.users.${homeManagerUser} = ...;}
shared.home = {name, cfg, myconfig, ...}: {};
# if moduleSystem == "darwin"
# then {config = ...;}
# else {}
shared.darwin = {name, cfg, myconfig, ...}: {};
}