1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-18 17:19:45 +01:00
home-manager/flake-module.nix
2024-04-05 09:35:21 +01:00

32 lines
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.raw;
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`.
'';
};
homeModules = mkOption {
type = types.lazyAttrsOf types.unspecified;
default = { };
apply = mapAttrs (k: v: {
_file = "${toString moduleLocation}#homeModules.${k}";
imports = [ v ];
});
description = ''
Home-Manager modules.
You may use this for reusable pieces of configuration, service modules, etc.
'';
};
};
};
}