summaryrefslogtreecommitdiff
path: root/modules/sys/core/home-manager.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2025-12-18 21:04:00 +0100
committeradikro <adikro@disroot.org>2025-12-18 21:04:00 +0100
commite60410393cea222b16743a1a87f29c06b9b3543b (patch)
tree8a574048613f6b13024795bd710b824b40f5db18 /modules/sys/core/home-manager.nix
parentea3bf9c87ee72d6da5ea2316b229082c7fc9cdf6 (diff)
rewrite of system modules, hm modules are next
Diffstat (limited to 'modules/sys/core/home-manager.nix')
-rw-r--r--modules/sys/core/home-manager.nix30
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;
+ };
+ };
+}