diff options
Diffstat (limited to 'util')
| -rw-r--r-- | util/default.nix | 6 | ||||
| -rw-r--r-- | util/host.nix | 75 | ||||
| -rw-r--r-- | util/user.nix | 51 |
3 files changed, 67 insertions, 65 deletions
diff --git a/util/default.nix b/util/default.nix index 1191065..7846328 100644 --- a/util/default.nix +++ b/util/default.nix @@ -1,4 +1,4 @@ -{home-manager, ...}: { - host = import ./host.nix {inherit home-manager;}; - user = import ./user.nix {inherit home-manager;}; +{ home-manager, ... }: { + host = import ./host.nix { inherit home-manager; }; + user = import ./user.nix { inherit home-manager; }; } diff --git a/util/host.nix b/util/host.nix index 869b674..a008566 100644 --- a/util/host.nix +++ b/util/host.nix @@ -1,41 +1,42 @@ -{home-manager, ...}: { - mkHost = { - name, - modules, - system ? "x86_64-linux", - specialArgs ? {}, - version ? "22.11", - pkgs, - }: { - ${name} = with pkgs.lib; - nixosSystem { - inherit system specialArgs; - modules = - [ - ../hosts/common - ../hosts/${name} +{ home-manager, ... }: { + mkHost = + { name + , modules + , system ? "x86_64-linux" + , specialArgs ? { } + , version ? "22.11" + , pkgs + , + }: { + ${name} = with pkgs.lib; + nixosSystem { + inherit system specialArgs; + modules = + [ + ../hosts/common + ../hosts/${name} - ({pkgs, ...}: { - system.stateVersion = version; - networking.hostName = mkDefault name; - # enable non-free packages - nixpkgs.config.allowUnfree = true; + ({ pkgs, ... }: { + system.stateVersion = version; + networking.hostName = mkDefault name; + # enable non-free packages + nixpkgs.config.allowUnfree = true; - # Enable nix flakes - nix.package = pkgs.nixFlakes; - nix.settings.experimental-features = ["nix-command" "flakes"]; - }) + # Enable nix flakes + nix.package = pkgs.nixFlakes; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + }) - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = specialArgs; - }; - } - ] - ++ modules; - }; - }; + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = specialArgs; + }; + } + ] + ++ modules; + }; + }; } diff --git a/util/user.nix b/util/user.nix index 62c29f2..eb12e16 100644 --- a/util/user.nix +++ b/util/user.nix @@ -1,26 +1,27 @@ -{home-manager, ...}: { - mkHMUser = { - username, - stateVersion ? "22.11", - system ? "x86_64-linux", - channel, - modules ? [], - }: - home-manager.lib.homeManagerConfiguration { - pkgs = channel.legacyPackages.${system}; - modules = - [ - ../users/${username}/home.nix - { - nixpkgs.config.allowUnfree = true; - systemd.user.startServices = true; - home = { - inherit username stateVersion; - homeDirectory = "/home/${username}"; - }; - programs.home-manager.enable = true; - } - ] - ++ modules; - }; +{ home-manager, ... }: { + mkHMUser = + { username + , stateVersion ? "22.11" + , system ? "x86_64-linux" + , channel + , modules ? [ ] + , + }: + home-manager.lib.homeManagerConfiguration { + pkgs = channel.legacyPackages.${system}; + modules = + [ + ../users/${username}/home.nix + { + nixpkgs.config.allowUnfree = true; + systemd.user.startServices = true; + home = { + inherit username stateVersion; + homeDirectory = "/home/${username}"; + }; + programs.home-manager.enable = true; + } + ] + ++ modules; + }; } |
