forked from irl/nix-configs
feat: use pipes to create homeConfigurations
This commit is contained in:
parent
de5a9787f6
commit
671533f47c
2 changed files with 57 additions and 28 deletions
49
flake.nix
49
flake.nix
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue