1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-06 16:57:03 +00:00
home-manager/flake-module.nix
isabel b15e9ec676
flake-module: set _class (#6461)
This should *help* prevent bad imports.
2025-02-16 13:57:15 -06:00

33 lines
1.1 KiB
Nix

{ lib, flake-parts-lib, moduleLocation, ... }:
let inherit (lib) toString mapAttrs mkOption types;
in {
options = {
flake = flake-parts-lib.mkSubmoduleOptions {
homeConfigurations = mkOption {
type = types.lazyAttrsOf types.deferredModule;
default = { };
description = ''
Instantiated Home Manager configurations.
`homeConfigurations` is for specific installations. If you want to expose
reusable configurations, add them to `homeModules` in the form of modules, so
that you can reference them in this or another flake's `homeConfigurations`.
'';
};
homeManagerModules = mkOption {
type = types.lazyAttrsOf types.unspecified;
default = { };
apply = mapAttrs (k: v: {
_class = "homeManager";
_file = "${toString moduleLocation}#homeManagerModules.${k}";
imports = [ v ];
});
description = ''
Home Manager modules.
You may use this for reusable pieces of configuration, service modules, etc.
'';
};
};
};
}