diff --git a/flake.nix b/flake.nix index 4dba214..17ea6cb 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,29 @@ ]); }; + Bacon = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit username pkgs; + }; + + modules = [ + ./system + ./system/_bacon.nix + ./hardware/bacon.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; [ + common-cpu-intel + common-pc-ssd + ]); + }; }; }; } diff --git a/hardware/bacon.hardware-configuration.nix b/hardware/bacon.hardware-configuration.nix new file mode 100755 index 0000000..6fd67fb --- /dev/null +++ b/hardware/bacon.hardware-configuration.nix @@ -0,0 +1,42 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/16a9b047-c117-4e46-87b7-0401ef22661b"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/C1BB-1322"; + fsType = "vfat"; + }; + + swapDevices = + [{ device = "/dev/disk/by-uuid/5b44f38e-93a8-495e-a94c-9a335fc0df9e"; }]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/system/_bacon.nix b/system/_bacon.nix new file mode 100644 index 0000000..3349629 --- /dev/null +++ b/system/_bacon.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: { + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware = { + graphics = { + enable = true; + extraPackages = with pkgs; [ + amdvlk + intel-media-driver + libvdpau-va-gl + nvidia-vaapi-driver + vaapiIntel + vaapiVdpau + vulkan-validation-layers + ]; + }; + + nvidia = { + modesetting.enable = true; + + powerManagement.enable = false; + powerManagement.finegrained = false; + + open = false; + nvidiaSettings = true; + + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + }; + + system = { + copySystemConfiguration = false; + stateVersion = "22.11"; + }; +}