about summary refs log tree commit diff
path: root/lib/mk_home.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2021-12-28 01:11:25 +0900
committersefidel <contact@sefidel.net>2021-12-28 01:12:48 +0900
commit56992b8c945d497a623fe693847c91235be1ae02 (patch)
tree102ff8c8872d7e14ce3e3dba69bf16685374504e /lib/mk_home.nix
downloadnixrc-56992b8c945d497a623fe693847c91235be1ae02.tar.gz
nixrc-56992b8c945d497a623fe693847c91235be1ae02.zip
initial commit
Diffstat (limited to 'lib/mk_home.nix')
-rw-r--r--lib/mk_home.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/mk_home.nix b/lib/mk_home.nix
new file mode 100644
index 0000000..e352f5f
--- /dev/null
+++ b/lib/mk_home.nix
@@ -0,0 +1,20 @@
+{ self, home-manager, ... } @ inputs:
+
+username: hostname: system: nixpkgs: version:
+let
+  args = inputs;
+  entrypoint = "${self}/home/configurations/${username}@${hostname}.nix";
+in
+  home-manager.lib.homeManagerConfiguration {
+    inherit username system;
+    homeDirectory = "/home/${username}";
+    stateVersion = version;    
+    pkgs = nixpkgs.legacyPackages.${system};
+
+    configuration = { lib, ... }: {
+      _module = { inherit args; };
+      imports = [
+        entrypoint
+      ] ++ __attrValues self.homeModules;
+    };
+  }