Closed Doosty closed 7 months ago
I think this is due to the attribute not having any merging strategy defined. In order to have a merging strategy you need to define an option for the attribute. I think this question was answered in #201.
You can use the mkSubmoduleOptions
from flake-parts-lib
.
See the example how it is done for nixosConfigurations: https://github.com/hercules-ci/flake-parts/blob/main/modules/nixosConfigurations.nix#L14
That works, thank you. For anyone wondering, all i did was import this file in my flake.nix and now homeConfigurations work the same as nixosConfigurations.
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
types
literalExpression
;
inherit (flake-parts-lib)
mkSubmoduleOptions
;
in
{
options = {
flake = mkSubmoduleOptions {
homeConfigurations = mkOption {
type = types.lazyAttrsOf types.raw;
default = { };
description = ''Instantiated Home-Manager configurations.'';
example = literalExpression ''{ "user@host" = inputs.home-manager.lib.homeManagerConfiguration { ..... }; }'';
};
};
};
}
Im not sure if i am using this right but of these three options
nixosConfigurations
works when defined multiple times buthomeConfigurations
andcolmena
give error: The option `flake.homeConfigurations' is defined multiple times while it's expected to be unique.Help much appreciated.
module file 1
module file 2