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 /lib | |
parent | b616fccab9b6e07590d1dcbbd3ddd04c2dd47d1c (diff) | |
download | nixrc-75423d76c840540cdbc157ca33b334744cf6ccca.tar.gz nixrc-75423d76c840540cdbc157ca33b334744cf6ccca.zip |
feat(home)!: 22.11 mkHome
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mk_home.nix | 26 |
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; } |