-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
refactorImprove the configuration codeImprove the configuration code
Description
Even if there is little code in there, it is already duplicated. Cf. mkNixos
and mkDarwin
nix-config/systems/nixos/default.nix
Lines 8 to 35 in e34d0fb
mkNixos = name: (let | |
config = import "${path}/home"; | |
user = config.user; | |
path = ./. + ("/" + name); | |
homeMods = lib.homeMods { | |
inherit inputs; | |
homeRoot = "${self}/home"; | |
config = config // {home = "/home/${user}";}; | |
}; | |
in | |
nixpkgs.lib.nixosSystem { | |
modules = [ | |
{ | |
networking.hostName = name; | |
nix.settings.trusted-users = [user]; | |
} | |
"${self}/etc/nixos" | |
path | |
home-manager.nixosModules.home-manager | |
homeMods | |
lib.commonMods | |
inputs.agenix.nixosModules.default | |
]; | |
# Give `inputs` access to all nix-darwin modules | |
specialArgs = {inherit inputs;}; | |
system = "x86_64-linux"; | |
}); |
nix-config/systems/darwin/default.nix
Lines 8 to 36 in e34d0fb
mkDarwin = name: (let | |
config = import "${path}/home"; | |
user = config.user; | |
path = ./. + ("/" + name); | |
homeMods = lib.homeMods { | |
inherit inputs; | |
homeRoot = "${self}/home"; | |
config = config // {home = "/Users/${user}";}; | |
}; | |
in | |
darwin.lib.darwinSystem { | |
modules = [ | |
{ | |
networking.hostName = name; | |
nix.settings.trusted-users = [user]; | |
} | |
"${self}/etc/darwin" | |
path | |
home-manager.darwinModules.home-manager | |
homeMods | |
inputs.agenix.darwinModules.default | |
lib.commonMods | |
{nixpkgs.overlays = [inputs.nixpkgs-firefox-darwin.overlay];} | |
]; | |
# Give `inputs` access to all nix-darwin modules | |
specialArgs = {inherit inputs;}; | |
system = "aarch64-darwin"; | |
}); |
Metadata
Metadata
Assignees
Labels
refactorImprove the configuration codeImprove the configuration code