mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
fix: flatten home configs into packages to satisfy flake schema
The previous fix exposed `.activationPackage` but still nested them under
`packages.<system>.homeConfigurations`, which is an attrset, not a derivation.
`nix flake check` requires EVERY attribute under `packages.<system>` to be
a derivation. Now flattening home configurations directly into packages with
the prefix `homeConfigurations-<name>` to ensure each is a top-level derivation.
Changes:
- Merge pipe result directly with `//` instead of nesting under `homeConfigurations`
- Prefix each home config with "homeConfigurations-" to avoid naming conflicts
Result: `packages.x86_64-linux.homeConfigurations-user` instead of
`packages.x86_64-linux.homeConfigurations.user`
This commit is contained in:
@@ -223,16 +223,19 @@ let
|
|||||||
// (builtins.listToAttrs (
|
// (builtins.listToAttrs (
|
||||||
builtins.map (system: {
|
builtins.map (system: {
|
||||||
name = system;
|
name = system;
|
||||||
value = flake-outputs.packages.${system} // {
|
value =
|
||||||
homeConfigurations = pipe homes [
|
flake-outputs.packages.${system}
|
||||||
|
// (pipe homes [
|
||||||
(filterAttrs (_: home: home.system == system))
|
(filterAttrs (_: home: home.system == system))
|
||||||
(mapAttrs (home-name: _: flake-outputs.homeConfigurations.${home-name}.activationPackage))
|
(mapAttrs (home-name: _: flake-outputs.homeConfigurations.${home-name}.activationPackage))
|
||||||
(mapAttrs' (
|
(mapAttrs' (
|
||||||
name: value:
|
name: value:
|
||||||
nameValuePair (if hasSuffix "@${system}" name then removeSuffix "@${system}" name else name) value
|
nameValuePair (
|
||||||
|
"homeConfigurations-"
|
||||||
|
+ (if hasSuffix "@${system}" name then removeSuffix "@${system}" name else name)
|
||||||
|
) value
|
||||||
))
|
))
|
||||||
];
|
]);
|
||||||
};
|
|
||||||
}) (builtins.attrNames flake-outputs.pkgs)
|
}) (builtins.attrNames flake-outputs.pkgs)
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user