diff options
Diffstat (limited to 'modules/sys/core/home-manager.nix')
| -rw-r--r-- | modules/sys/core/home-manager.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/sys/core/home-manager.nix b/modules/sys/core/home-manager.nix new file mode 100644 index 0000000..06f909f --- /dev/null +++ b/modules/sys/core/home-manager.nix @@ -0,0 +1,30 @@ +{ config, lib, inputs, ... }: +{ + options.szpont.home-manager = { + enable = lib.mkEnableOption "Home Manager configuration manager"; + + users = lib.mkOption { + default = {}; + description = "Attribute set of users and their home-manager configurations"; + type = lib.types.attrsOf (lib.types.submodule { + options = { + path = lib.mkOption { + type = lib.types.path; + description = "Path to the user's home.nix file"; + }; + }; + }); + }; + }; + + config = lib.mkIf config.szpont.home-manager.enable { + home-manager = { + extraSpecialArgs = { inherit inputs; }; + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "bak"; + + users = lib.mapAttrs (name: user: import user.path) config.szpont.home-manager.users; + }; + }; +} |
