summaryrefslogtreecommitdiff
path: root/sys/core/home-manager.nix
diff options
context:
space:
mode:
Diffstat (limited to 'sys/core/home-manager.nix')
-rw-r--r--sys/core/home-manager.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/core/home-manager.nix b/sys/core/home-manager.nix
new file mode 100644
index 0000000..df9a518
--- /dev/null
+++ b/sys/core/home-manager.nix
@@ -0,0 +1,34 @@
+{ inputs, config, lib,... }:
+let
+ cfg = config.szpont.sys.core.home-manager;
+in
+{
+ imports = [ inputs.home-manager.nixosModules.home-manager ];
+ options.szpont.sys.core.home-manager = {
+ enable = lib.mkEnableOption "home Manager configuration";
+
+ 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 cfg.enable {
+ home-manager = {
+ extraSpecialArgs = { inherit inputs; };
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ backupFileExtension = "bak";
+
+ users = lib.mapAttrs (name: user: import user.path) cfg.users;
+ };
+ };
+}