summaryrefslogtreecommitdiff
path: root/os/core/home-manager.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2025-12-24 16:21:00 +0100
committeradikro <adikro@disroot.org>2025-12-24 16:21:00 +0100
commit6aaa5993e4c1cfb205ed555d958702f9bba1770d (patch)
tree3af8cf20967cf10542edd2e51232b1da70002fde /os/core/home-manager.nix
parent2ceabfd1d1dc03ca895e960048b73a82e29e45e8 (diff)
a bunch of changes, renames sys to os and refactored some of the logic
Diffstat (limited to 'os/core/home-manager.nix')
-rw-r--r--os/core/home-manager.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/os/core/home-manager.nix b/os/core/home-manager.nix
new file mode 100644
index 0000000..7bc4b18
--- /dev/null
+++ b/os/core/home-manager.nix
@@ -0,0 +1,36 @@
+{ inputs, config, lib, username, ... }:
+let
+ cfg = config.sys.core.home-manager;
+in
+{
+ imports = [ inputs.home-manager.nixosModules.home-manager ];
+
+ options.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 username; };
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ backupFileExtension = "bak";
+
+ users = lib.mapAttrs (name: userCfg: {
+ imports = [ userCfg.path ];
+ }) cfg.users;
+ };
+ };
+}