1
0
Fork 0
forked from irl/nix-configs

feat: use pipes to create homeConfigurations

This commit is contained in:
Iain Learmonth 2025-07-07 14:36:56 +01:00
parent de5a9787f6
commit 671533f47c
2 changed files with 57 additions and 28 deletions

View file

@ -36,11 +36,6 @@
sops-nix,
}@inputs:
let
homeRoles = [
"desktop"
"minimal"
"server"
];
outputs = inputs.self;
overlays = [
apple-silicon.overlays.apple-silicon-overlay
@ -74,23 +69,35 @@
};
};
homeManagerModules = import ./modules/home-manager;
homeConfigurations = nixpkgs.lib.foldl' (c: e:
c // {
"irl-${e.role}-${e.system}" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit overlays;
system = e.system;
};
extraSpecialArgs = {
inherit outputs;
};
modules = [
./home-manager/irl.nix
{ role = "${e.role}"; }
];
};
homeConfigurations =
{
role = [
"desktop"
"minimal"
"server"
];
system = supportedSystems;
}
) { } (nixpkgs.lib.cartesianProduct { role = homeRoles; system = supportedSystems; });
|> nixpkgs.lib.cartesianProduct
|> nixpkgs.lib.foldl' (
c: e:
c
// {
"irl-${e.role}-${e.system}" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit overlays;
system = e.system;
};
extraSpecialArgs = {
inherit outputs;
};
modules = [
./home-manager/irl.nix
{ role = "${e.role}"; }
];
};
}
) { };
}
// flake-utils.lib.eachSystem supportedSystems (system: {
formatter = nixpkgs.legacyPackages.${system}.nixfmt-tree;