nix-darwin: extract personal configuration from modules

This commit is contained in:
Primrose 2025-02-19 12:28:32 +01:00
parent 28d52c2624
commit 05ed42b0af
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 22 additions and 24 deletions

View file

@ -106,11 +106,29 @@
}: [
{nixpkgs.hostPlatform = system;}
nixpkgsConfig
self.darwinModules.commonModules
self.darwinModules.${"named-" + hostname}
or (abort ''
Expects a named nix-darwin module corresponding to the nix-darwin Configuration.
What you are doing doesn't make sense.
'')
inputs.home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs.hostname = hostname;
users.leana.imports = [
self.homeModules.${"named-" + hostname}
or (
builtins.trace "No named home-manager configuration supplied for named nix-darwin config `${hostname}', defaulting to common modules."
self.homeModules.commonModules
)
];
};
}
];
in
many (mkDarwin sharedModules);