diff options
author | sefidel <contact@sefidel.net> | 2022-07-22 18:42:56 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2022-07-22 18:42:56 +0900 |
commit | 75423d76c840540cdbc157ca33b334744cf6ccca (patch) | |
tree | 1f1d173402500ad22bde7c3646efeacf423d7b75 | |
parent | b616fccab9b6e07590d1dcbbd3ddd04c2dd47d1c (diff) | |
download | nixrc-75423d76c840540cdbc157ca33b334744cf6ccca.tar.gz nixrc-75423d76c840540cdbc157ca33b334744cf6ccca.zip |
feat(home)!: 22.11 mkHome
-rw-r--r-- | home/default.nix | 3 | ||||
-rw-r--r-- | lib/mk_home.nix | 26 |
2 files changed, 15 insertions, 14 deletions
diff --git a/home/default.nix b/home/default.nix index ce303b4..f8ce8fe 100644 --- a/home/default.nix +++ b/home/default.nix @@ -4,8 +4,7 @@ "zach@alpha" = self.lib.mkHome { username = "zach"; hostname = "alpha"; - system = "x86_64-linux"; - pkgs = import unstable { system = "x86_64-linux"; overlays = with inputs; [ chaotic-nixpkgs.overlay rust.overlay ]; }; + pkgs = import unstable { system = "x86_64-linux"; overlays = with inputs; [ chaotic-nixpkgs.overlay rust.overlays.default ]; }; extraModules = [ ./profiles/populate.nix 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; } |