diff options
| author | seth <[email protected]> | 2023-02-15 02:52:52 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-02-15 02:52:52 -0500 |
| commit | 2633e7bcf3b42447d88dbb5645c2f7d0cb9a1418 (patch) | |
| tree | f1f62bffb2189cb65ae649e44bb3fc1a4b558960 | |
| parent | ed5a2aabd9d2253f9f7a9739f8b911f24f36101a (diff) | |
improve mkHost
| -rw-r--r-- | flake.nix | 39 | ||||
| -rw-r--r-- | users/seth/home.nix | 4 | ||||
| -rw-r--r-- | util/host.nix | 6 | ||||
| -rw-r--r-- | util/user.nix | 27 |
4 files changed, 48 insertions, 28 deletions
@@ -19,31 +19,47 @@ ... }: let util = import ./util {inherit inputs home-manager;}; - inherit (util) host; - inherit (util) user; + inherit (util) host user; in { homeConfigurations = { seth = user.mkHMUser { username = "seth"; stateVersion = "23.05"; channel = nixpkgsUnstable; + modules = [ + ({config, ...}: { + config.seth.standalone = true; + }) + ]; }; }; - nixosConfigurations = { - glados = host.mkHost { + nixosConfigurations = + (host.mkHost { name = "glados"; modules = [ + nixos-hardware.nixosModules.common-cpu-amd-pstate + nixos-hardware.nixosModules.common-gpu-nvidia-nonprime + nixos-hardware.nixosModules.common-pc-ssd lanzaboote.nixosModules.lanzaboote + ./users/seth + ./users/seth/options.nix + + { + seth.desktop = "gnome"; + seth.devel.enable = true; + } ]; + version = "23.05"; pkgs = nixpkgsUnstable; - }; - glados-wsl = host.mkHost { + }) + // (host.mkHost { name = "glados-wsl"; modules = [ nixos-wsl.nixosModules.wsl + ({lib, ...}: { environment.noXlibs = lib.mkForce false; wsl = { @@ -55,11 +71,16 @@ interop.includePath = false; }; }) - nixos-hardware.nixosModules.common-cpu-amd-pstate + ./users/seth + ./users/seth/options.nix + + { + seth.devel.enable = true; + } ]; + pkgs = nixpkgs; - }; - }; + }); }; } diff --git a/users/seth/home.nix b/users/seth/home.nix index 79776b6..736327d 100644 --- a/users/seth/home.nix +++ b/users/seth/home.nix @@ -5,8 +5,4 @@ _: { ./programs ./shell ]; - - seth.devel.enable = true; - seth.desktop = "gnome"; - # seth.standalone = true; } diff --git a/util/host.nix b/util/host.nix index 637f0f3..c1dc5dd 100644 --- a/util/host.nix +++ b/util/host.nix @@ -5,8 +5,8 @@ system ? "x86_64-linux", version ? "22.11", pkgs, - }: - with pkgs.lib; + }: { + ${name} = with pkgs.lib; nixosSystem { inherit system; modules = @@ -22,7 +22,6 @@ # Enable nix flakes nix.package = pkgs.nixFlakes; - nix.settings.experimental-features = ["nix-command" "flakes"]; }) home-manager.nixosModules.home-manager @@ -33,4 +32,5 @@ ] ++ modules; }; + }; } diff --git a/util/user.nix b/util/user.nix index e69d46c..3d16651 100644 --- a/util/user.nix +++ b/util/user.nix @@ -4,20 +4,23 @@ 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 = + [ + ../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; }; } |
