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:
anntnzrb
2025-10-09 00:34:37 -05:00
parent f92dcdecbb
commit 1e41848ba9

View File

@@ -223,16 +223,19 @@ let
// (builtins.listToAttrs (
builtins.map (system: {
name = system;
value = flake-outputs.packages.${system} // {
homeConfigurations = pipe homes [
value =
flake-outputs.packages.${system}
// (pipe homes [
(filterAttrs (_: home: home.system == system))
(mapAttrs (home-name: _: flake-outputs.homeConfigurations.${home-name}.activationPackage))
(mapAttrs' (
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)
));
};