diff --git a/.gitignore b/.gitignore index e1935b5..397b4a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -hardware-configuration.nix *.log diff --git a/hosts/ArcticFox/configuration.nix b/hosts/ArcticFox/configuration.nix index 22ee800..f390663 100644 --- a/hosts/ArcticFox/configuration.nix +++ b/hosts/ArcticFox/configuration.nix @@ -9,8 +9,8 @@ }: { imports = [ # Include the results of the hardware scan. - /etc/nixos/hardware-configuration.nix - ../../packet-tracer.nix + ./hardware-configuration.nix + ../../modules/packet-tracer.nix ./local-packages.nix ]; @@ -233,27 +233,6 @@ }; nix.settings.auto-optimise-store = true; - ############# - ### hardware - ############# - - # everything amd gpu - hardware.graphics.enable32Bit = true; - hardware.graphics.extraPackages = [ - pkgs.rocmPackages.clr.icd - pkgs.libva - ]; - - boot.initrd.kernelModules = ["amdgpu"]; - boot.kernelModules = ["amdgpu"]; - hardware.amdgpu.overdrive.ppfeaturemask = "0xffffffff"; - - services.hardware.openrgb.enable = true; - hardware.openrazer = { - enable = true; - users = ["sarah"]; - }; - services.xserver.videoDrivers = ["amdgpu"]; environment.variables = { diff --git a/hosts/ArcticFox/hardware-configuration.nix b/hosts/ArcticFox/hardware-configuration.nix new file mode 100644 index 0000000..e9d9104 --- /dev/null +++ b/hosts/ArcticFox/hardware-configuration.nix @@ -0,0 +1,63 @@ +# 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 = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + boot.kernelModules = ["kvm-amd" "amdgpu"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/50366080-c1da-4726-b930-e5cd619afaaa"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/A720-72DC"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f4b35122-4041-4b39-a9e0-5358f7e4b634";} + ]; + + # 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; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + ############# + ### hardware + ############# + + # everything amd gpu + hardware.graphics.enable32Bit = true; + hardware.graphics.extraPackages = [ + pkgs.rocmPackages.clr.icd + pkgs.libva + ]; + + boot.initrd.kernelModules = ["amdgpu"]; + hardware.amdgpu.overdrive.ppfeaturemask = "0xffffffff"; + + services.hardware.openrgb.enable = true; + hardware.openrazer = { + enable = true; + users = ["sarah"]; + }; +} diff --git a/packet-tracer.nix b/modules/packet-tracer.nix similarity index 93% rename from packet-tracer.nix rename to modules/packet-tracer.nix index 382490d..6cdd9d2 100644 --- a/packet-tracer.nix +++ b/modules/packet-tracer.nix @@ -5,7 +5,7 @@ }: { nixpkgs.config.packageOverrides = pkgs: { ciscoPacketTracer8 = pkgs.ciscoPacketTracer8.override { - packetTracerSource = /home/sarah/CiscoPacketTracer822_amd64_signed.deb; + packetTracerSource = ../resources/CiscoPacketTracer822_amd64_signed.deb; }; }; diff --git a/rebuild.sh b/rebuild.sh index 5c99215..b1a6b05 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -4,7 +4,6 @@ set -e if git diff --quiet '*.nix'; then echo "No changes detected, exiting" - exit 0 fi alejandra . &>/dev/null || @@ -17,7 +16,7 @@ git diff -U0 '*.nix' echo "NixOS rebuilding..." -sudo nixos-rebuild switch --impure --flake . &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) +sudo nixos-rebuild switch --flake . &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) current=$(nixos-rebuild list-generations --json | jq '.[] | select (.current == true) | "\(.generation) \(.date) \(.nixosVersion) \(.kernelVersion)"') diff --git a/resources/CiscoPacketTracer822_amd64_signed.deb b/resources/CiscoPacketTracer822_amd64_signed.deb new file mode 100644 index 0000000..bc382ca Binary files /dev/null and b/resources/CiscoPacketTracer822_amd64_signed.deb differ