mirror of
https://github.com/nix-community/home-manager
synced 2024-11-18 17:19:45 +01:00
Add flake-parts module
This commit is contained in:
parent
0c73c1b8da
commit
5f48f4fb55
2 changed files with 37 additions and 0 deletions
32
flake-module.nix
Normal file
32
flake-module.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ 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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -19,6 +19,11 @@
|
|||
# unofficial; deprecated in Nix 2.8
|
||||
darwinModule = self.darwinModules.default;
|
||||
|
||||
flakeModules = rec {
|
||||
home-manager = import ./flake-module.nix;
|
||||
default = home-manager;
|
||||
};
|
||||
|
||||
templates = {
|
||||
standalone = {
|
||||
path = ./templates/standalone;
|
||||
|
|
Loading…
Reference in a new issue