diff --git a/flake.nix b/flake.nix index d978b7c..4dba214 100644 --- a/flake.nix +++ b/flake.nix @@ -100,31 +100,33 @@ }; }) // { - nixosConfigurations.Bacon = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit username pkgs; + nixosConfigurations = { + Sigmachine = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit username pkgs; + }; + + modules = [ + ./system + ./system/_sigmachine.nix + ./hardware/sigmachine.hardware-configuration.nix + ] ++ [ + { networking.hostName = "Sigmachine"; } + { nixpkgs.hostPlatform = system; } + ] ++ [ + home-manager.nixosModules.home-manager + home-manager-config + ] ++ [ + hosts.nixosModule + ({ networking.stevenBlackHosts.enable = true; }) + ] ++ (with nixos-hardware.nixosModules; [ + asus-battery + common-pc-laptop + common-cpu-amd + common-pc-ssd + ]); }; - modules = [ - ./system - ./hardware-configuration.nix - ] ++ [ - { networking.hostName = "Bacon"; } - { nixpkgs.hostPlatform = system; } - ] ++ [ - home-manager.nixosModules.home-manager - home-manager-config - ] ++ [ - hosts.nixosModule - ({ - networking.stevenBlackHosts.enable = true; - }) - ] ++ (with nixos-hardware.nixosModules; [ - asus-battery - common-pc-laptop - common-cpu-amd - common-pc-ssd - ]); }; }; } diff --git a/hardware-configuration.nix b/hardware/sigmachine.hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hardware/sigmachine.hardware-configuration.nix diff --git a/system/_sigmachine.nix b/system/_sigmachine.nix new file mode 100644 index 0000000..6514e15 --- /dev/null +++ b/system/_sigmachine.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: { + boot.initrd.kernelModules = [ "amdgpu" ]; + + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware = { + nvidia = { + modesetting.enable = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + + powerManagement.enable = false; + powerManagement.finegrained = false; + + open = false; + nvidiaSettings = true; + + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + + amdgpuBusId = "PCI:5:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; + + graphics = { + enable = true; + + extraPackages = with pkgs; [ + amdvlk + libvdpau-va-gl + nvidia-vaapi-driver + vaapiVdpau + vulkan-validation-layers + ]; + }; + }; + + system = { + copySystemConfiguration = false; + stateVersion = "22.11"; + }; +} diff --git a/system/default.nix b/system/default.nix index 1086bc0..397215e 100644 --- a/system/default.nix +++ b/system/default.nix @@ -4,10 +4,7 @@ boot = { consoleLogLevel = 0; - initrd = { - verbose = false; - kernelModules = [ "amdgpu" ]; - }; + initrd.verbose = false; loader = { efi.canTouchEfiVariables = true; @@ -73,38 +70,6 @@ hardware = { pulseaudio.enable = false; - graphics = { - enable = true; - - extraPackages = with pkgs; [ - amdvlk - libvdpau-va-gl - nvidia-vaapi-driver - vaapiVdpau - vulkan-validation-layers - ]; - }; - - nvidia = { - modesetting.enable = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - - powerManagement.enable = false; - powerManagement.finegrained = false; - - open = false; - nvidiaSettings = true; - - prime = { - offload = { - enable = true; - enableOffloadCmd = true; - }; - - amdgpuBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; }; programs = { @@ -190,8 +155,6 @@ "${ouioui}/share/X11/xkb/symbols/us_qwerty-fr"; }; }; - - videoDrivers = [ "nvidia" ]; windowManager.qtile.enable = true; }; @@ -266,11 +229,6 @@ ]; }; - system = { - copySystemConfiguration = false; - stateVersion = "22.11"; - }; - qt.style = "adwaita-dark"; xdg.portal = { enable = true;