diff options
author | sefidel <contact@sefidel.net> | 2024-01-23 00:20:54 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2024-01-23 01:05:04 +0900 |
commit | b311d7f8459fe1e90f7b0cbf5862b22a2cbedff5 (patch) | |
tree | d7b8af8e685699a1e66afcb10b668363d604106e /lib/mk_home.nix | |
parent | b670811db1c645c9c4effff1829e90b380318427 (diff) | |
download | nixrc-b311d7f8459fe1e90f7b0cbf5862b22a2cbedff5.tar.gz nixrc-b311d7f8459fe1e90f7b0cbf5862b22a2cbedff5.zip |
feat(lib)!: refactor
Diffstat (limited to 'lib/mk_home.nix')
-rw-r--r-- | lib/mk_home.nix | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/lib/mk_home.nix b/lib/mk_home.nix index 925fdbe..8e63324 100644 --- a/lib/mk_home.nix +++ b/lib/mk_home.nix @@ -1,29 +1,30 @@ { self, home-manager, ... } @ inputs: +{ + mkHome = { username, hostname, pkgs, version, extraModules ? null }: + let + entrypoint = "${self}/home/configs/${hostname}/${username}.nix"; + defaultModule = { lib, config, ... }: { + _module.args.inputs = self.inputs; + _module.args.self = self; -{ username, hostname, pkgs, version, extraModules ? null }: -let - entrypoint = "${self}/home/configs/${hostname}/${username}.nix"; - defaultModule = { lib, config, ... }: { - _module.args.inputs = self.inputs; - _module.args.self = self; + manual = { + html.enable = false; + manpages.enable = false; + json.enable = false; + }; - manual = { - html.enable = false; - manpages.enable = false; - json.enable = false; + home = { + inherit username; + homeDirectory = "/home/${username}"; + stateVersion = version; + }; + }; + in + home-manager.lib.homeManagerConfiguration { + pkgs = pkgs; + modules = [ + defaultModule + entrypoint + ] ++ pkgs.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; } |