summaryrefslogtreecommitdiffstats
path: root/hosts/jonbox/hardware.nix
blob: bbe651fcfbea79b868eeaf28f4465315af2089be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ 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 = [ "compress=zstd" "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;
    services.btrfs.autoScrub =
    {
        enable = true;
        interval = "weekly";
    };

    #Hardware
    hardware.nvidia = {
        modesetting.enable = true;
        powerManagement.enable = false;
        powerManagement.finegrained = false;
        open = false;
        nvidiaSettings = true;
        package = config.boot.kernelPackages.nvidiaPackages.beta;
    };

    #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;
}