summaryrefslogtreecommitdiffstats
path: root/hosts/jontop/hardware.nix
blob: dc5af7e5776c1859a59231603ace2a93e7b78e13 (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
{ config, lib, pkgs, nixos-hardware, modulesPath, ... }:
{
    imports = 
    [
        (modulesPath + "/installer/scan/not-detected.nix")
        nixos-hardware.nixosModules.lenovo-thinkpad-x220
    ];

    boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
    boot.initrd.kernelModules = [ "i915" ];
    boot.kernelModules = [ "kvm-intel" ];
    boot.extraModulePackages = [ ];

    fileSystems."/" =
        { device = "/dev/disk/by-uuid/72e455f9-4b10-4cb2-a8e4-cfe39c4a8d1f";
          fsType = "btrfs";
        };
    
    fileSystems."/boot" =
        { device = "/dev/disk/by-uuid/27F7-4AFD";
          fsType = "vfat";
        };
    
    swapDevices =
        [ { device = "/dev/disk/by-uuid/4133a381-ab7d-4a25-9013-3f4b2d31bc5a"; }
        ];

    #SSD-optimization
    services.fstrim.enable = true;

    #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 = "jontop";
    networking.useDHCP = lib.mkDefault true;
    networking.networkmanager.enable = true;
}