Structure
Function Arguments
name
: a string representing the host name.homeManagerSystem
: a string used in thepkgs
attribute of thehome-manager.lib.homeManagerConfiguration
function, which is used in thedelib.configurations
function ashomeManagerNixpkgs.legacyPackages.${homeManagerSystem}
.myconfig
: sets its value toconfig.${myconfigName}
ifconfig.${myconfigName}.host
matches the current host.nixos
: sets its value toconfig
ifisHomeManager
isfalse
andconfig.${myconfigName}.host
matches the current host.home
: sets its value toconfig
ifisHomeManager
istrue
andconfig.${myconfigName}.host
matches the current host. Otherwise, ifconfig.${myconfigName}.host
matches the current host, sets its value toconfig.home-manager.users.${homeManagerUser}
.shared.myconfig
: sets its value toconfig.${myconfigName}
for all hosts.shared.nixos
: sets its value toconfig
ifisHomeManager
isfalse
. Otherwise, does nothing.shared.home
: sets its value toconfig
ifisHomeManager
istrue
. Otherwise, sets it toconfig.home-manager.users.${homeManagerUser}
.
Passed Arguments
A list of arguments passed to ?(shared.)[myconfig|nixos|home]
if their type is lambda
:
name
: the samename
as in the arguments ofdelib.host
.myconfig
: equalsconfig.${myConfigName}
.cfg
: equalsconfig.${myConfigName}.hosts.${delib.host :: name}
.
Pseudocode
nix
delib.host {
name = "";
# 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 {config = ...;}
# else {}
nixos = {name, cfg, myconfig, ...}: {};
# if config.${myconfigName}.host == name, then
# if isHomeManager
# then {config = ...;}
# else {config.home-manager.users.${homeManagerUser} = ...;}
# else {}
home = {name, cfg, myconfig, ...}: {};
# config.${myConfigName} = ...
shared.myconfig = {name, cfg, myconfig, ...}: {};
# config = ...
shared.nixos = {name, cfg, myconfig, ...}: {};
# if isHomeManager
# then {}
# else {config = ...;}
shared.home = {name, cfg, myconfig, ...}: {};
}