From f819e30b03dffcf9e74af4b8552e4a8ab8f54c58 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 29 Sep 2023 14:22:24 -0400 Subject: major reorganizing to seperate modules --- hosts/jonbox/default.nix | 43 ++++++++++++++++++++++++++++++ hosts/jonbox/filesystem.nix | 4 +++ hosts/jonbox/hardware.nix | 65 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 hosts/jonbox/default.nix create mode 100644 hosts/jonbox/filesystem.nix create mode 100644 hosts/jonbox/hardware.nix (limited to 'hosts/jonbox') diff --git a/hosts/jonbox/default.nix b/hosts/jonbox/default.nix new file mode 100644 index 0000000..ce5f4a3 --- /dev/null +++ b/hosts/jonbox/default.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, stateVersion, ... }: + +{ + imports = [ + ./hardware.nix + ../../modules/hardware/bluetooth.nix + ../../modules/virt + ]; + + #Boot options + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 8; + }; + efi.canTouchEfiVariables = true; + timeout = 5; + }; + kernelPackages = pkgs.linuxPackages_latest; + }; + + #Unfree-packages. + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "nvidia-x11" + "nvidia-settings" + "nvidia-persistenced" + ]; + + #OpenGL + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + #X11 Server + services.xserver.videoDrivers = [ "nvidia" ]; + + awesome.enable = true; + mullvad-vpn.enable = true; +} diff --git a/hosts/jonbox/filesystem.nix b/hosts/jonbox/filesystem.nix new file mode 100644 index 0000000..5b8ec2b --- /dev/null +++ b/hosts/jonbox/filesystem.nix @@ -0,0 +1,4 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ +} diff --git a/hosts/jonbox/hardware.nix b/hosts/jonbox/hardware.nix new file mode 100644 index 0000000..ce734fe --- /dev/null +++ b/hosts/jonbox/hardware.nix @@ -0,0 +1,65 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + #Filesystems + fileSystems."/" = + { device = "/dev/disk/by-uuid/83cafaff-8be3-477f-b13c-c47dafdf969d"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/40EA-5550"; + fsType = "vfat"; + }; + + fileSystems."/mnt/jonshare" = { + device = "homenas:/var/data/jon"; + fsType = "nfs"; + }; + + fileSystems."/mnt/plexshare" = { + device = "homenas:/var/data/plex"; + fsType = "nfs"; + }; + + fileSystems."/mnt/share" = { + device = "homenas:/var/data/shared"; + fsType = "nfs"; + }; + + swapDevices = + [ + { device = "/dev/disk/by-uuid/acfc7ea5-0787-4e05-bcf1-20b7adb0f35c"; } + ]; + + #SSD-optimization + services.fstrim.enable = true; + + #Hardware + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + #Firmware + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + #Networking + networking.hostName = "jonbox"; + networking.useDHCP = lib.mkDefault true; + networking.networkmanager.enable = true; +} -- cgit v1.2.1