From 2726e125f8e46bc46cc4d80be741544e1298bc8b Mon Sep 17 00:00:00 2001 From: Annika Merris Date: Tue, 21 May 2024 11:27:13 -0400 Subject: [PATCH] Moving Hardware Configuration To a Separate File --- hosts/kim/default.nix | 29 ++-------------------------- hosts/kim/hardware-configuration.nix | 29 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 hosts/kim/hardware-configuration.nix diff --git a/hosts/kim/default.nix b/hosts/kim/default.nix index d730c78..bd101e0 100644 --- a/hosts/kim/default.nix +++ b/hosts/kim/default.nix @@ -12,6 +12,7 @@ inputs.nixpkgs.lib.nixosSystem { lix-module.nixosModules.default home-manager.nixosModules.home-manager sops-nix.nixosModules.sops + ./hardware-configuration.nix ../../modules/common ../../modules/nixos { @@ -21,35 +22,8 @@ inputs.nixpkgs.lib.nixosSystem { physical = true; networking.hostName = "kim"; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - # boot.loader.grub.device = "/dev/vda"; - services.xserver.videoDrivers = [ "amdgpu" ]; # TODO: I use wayland, do I need this? - hardware.enableRedistributableFirmware = true; - powerManagement.cpuFreqGovernor = "performance"; - - fileSystems."/" = - { - device = "/dev/disk/by-uuid/ba4362a3-3a0b-4227-b460-a5a9302f5966"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/DB88-8E65"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - swapDevices = [ ]; - networking.useDHCP = nixpkgs.lib.mkDefault true; - nixpkgs.hostPlatform = nixpkgs.lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = true; - # TODO: identityFile = "/home/${globals.user}/.ssh/id_ed2519"; # TODO: passwordHash = nixpkgs.lib.fileContents ../../password.sha512; @@ -113,6 +87,7 @@ inputs.nixpkgs.lib.nixosSystem { spotifyd.enable = true; # Programming Stuff nixpkgs-fmt.enable = true; + python3.enable = true; vscode.enable = true; # Utilities # git is not optional diff --git a/hosts/kim/hardware-configuration.nix b/hosts/kim/hardware-configuration.nix new file mode 100644 index 0000000..17199f9 --- /dev/null +++ b/hosts/kim/hardware-configuration.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + # boot.loader.grub.device = "/dev/vda"; + services.xserver.videoDrivers = [ "amdgpu" ]; # TODO: I use wayland, do I need this? + hardware.enableRedistributableFirmware = true; + powerManagement.cpuFreqGovernor = "performance"; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/ba4362a3-3a0b-4227-b460-a5a9302f5966"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/DB88-8E65"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = nixpkgs.lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = true; +}