about summary refs log tree commit diff
path: root/lib/mk_home.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-07-22 18:42:56 +0900
committersefidel <contact@sefidel.net>2022-07-22 18:42:56 +0900
commit75423d76c840540cdbc157ca33b334744cf6ccca (patch)
tree1f1d173402500ad22bde7c3646efeacf423d7b75 /lib/mk_home.nix
parentb616fccab9b6e07590d1dcbbd3ddd04c2dd47d1c (diff)
downloadnixrc-75423d76c840540cdbc157ca33b334744cf6ccca.tar.gz
nixrc-75423d76c840540cdbc157ca33b334744cf6ccca.zip
feat(home)!: 22.11 mkHome
Diffstat (limited to 'lib/mk_home.nix')
-rw-r--r--lib/mk_home.nix26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/mk_home.nix b/lib/mk_home.nix
index 6682d78..b2f87dc 100644
--- a/lib/mk_home.nix
+++ b/lib/mk_home.nix
@@ -1,16 +1,9 @@
 { self, home-manager, ... } @ inputs:
 
-{ username, hostname, system ? "x86_64-linux", pkgs, version, extraModules ? null }:
+{ username, hostname, pkgs, version, extraModules ? null }:
 let
   entrypoint = "${self}/home/${hostname}/${username}.nix";
-in
-home-manager.lib.homeManagerConfiguration {
-  inherit username system;
-  homeDirectory = "/home/${username}";
-  stateVersion = version;
-  pkgs = pkgs;
-
-  configuration = { lib, ... }: {
+  defaultModule = { lib, ... }: {
     _module.args.inputs = self.inputs;
     _module.args.self = self;
 
@@ -20,8 +13,17 @@ home-manager.lib.homeManagerConfiguration {
       json.enable = false;
     };
 
-    imports = [
-      entrypoint
-    ] ++ lib.optionals (extraModules != null) extraModules;
+    home = {
+      inherit username;
+      homeDirectory = "/home/${username}";
+      stateVersion = version;
+    };
   };
+in
+home-manager.lib.homeManagerConfiguration {
+  pkgs = pkgs;
+  modules = [
+    defaultModule
+    entrypoint
+  ] ++ pkgs.lib.optionals (extraModules != null) extraModules;
 }