nixos-config/hosts/desktop/hardware-configuration.nix

115 lines
3.5 KiB
Nix
Raw Normal View History

2022-11-05 10:25:12 +01:00
#
# Hardware settings for Teclast F5 10" Laptop
# NixOS @ sda2
#
# flake.nix
# └─ ./hosts
# └─ ./laptop
# └─ hardware-configuration.nix *
#
# 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 = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
2022-11-05 10:25:12 +01:00
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" "vfio_virqfd" ];
boot.kernelModules = [ "kvm-amd" ];
2022-11-05 10:25:12 +01:00
boot.extraModulePackages = [ ];
2023-01-07 08:38:47 +01:00
boot.tmpOnTmpfs = true;
2023-01-07 08:56:04 +01:00
zramSwap.enable = true;
2022-11-05 10:25:12 +01:00
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
2022-11-05 10:25:12 +01:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
2022-11-05 10:25:12 +01:00
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/NIXROOT";
2022-11-05 10:25:12 +01:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
};
fileSystems."/home/.snapshots" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
2022-11-05 10:25:12 +01:00
};
fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT";
2022-11-05 10:25:12 +01:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
2022-11-05 10:25:12 +01:00
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
2022-11-05 10:25:12 +01:00
fsType = "vfat";
};
2023-01-07 19:43:12 +01:00
fileSystems."/mnt/Pluto" =
{ device = "nas:/Pluto";
2023-01-07 19:43:12 +01:00
fsType = "nfs";
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2" ];
2023-01-07 19:43:12 +01:00
};
2023-01-08 12:29:50 +01:00
fileSystems."/mnt/Mars" =
{ device = "nas:/Mars";
fsType = "nfs";
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2" ];
};
# fileSystems."/mnt/Pluto" =
# { device = "nas:/Pluto/nix";
# fsType = "nfs";
# options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2,local_lock=all" ];
# };
2022-11-05 10:25:12 +01:00
swapDevices = [ ];
networking = {
useDHCP = false; # Deprecated
hostName = "hades";
networkmanager = {
enable = true;
};
interfaces = {
enp34s0 = {
2022-11-05 10:25:12 +01:00
useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
#ipv4.addresses = [ {
# address = "192.168.0.51";
# prefixLength = 24;
#} ];
};
};
#defaultGateway = "192.168.0.1";
#nameservers = [ "192.168.0.4" ];
#firewall = {
# enable = false;
# #allowedUDPPorts = [ 53 67 ];
# #allowedTCPPorts = [ 53 80 443 9443 ];
#};
};
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
2022-11-05 10:25:12 +01:00
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
2023-01-08 13:47:56 +01:00
#powerManagement.powertop.enable = true;
powerManagement = {
scsiLinkPolicy = "med_power_with_dipm";
};
2022-11-05 10:25:12 +01:00
}