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

127 lines
3.6 KiB
Nix
Raw Normal View History

2022-09-17 16:50:50 +02: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 = [ "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" "rtsx_usb_sdmmc" ];
2022-11-03 16:12:30 +01:00
boot.initrd.kernelModules = [ "i915" ];
2022-09-17 16:50:50 +02:00
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
2022-11-06 17:01:18 +01:00
boot.kernelParams = [ "mitigations=off" "luks.options=fido2-device=auto" ];
2023-01-07 08:38:47 +01:00
boot.tmpOnTmpfs = true;
2023-01-07 08:56:04 +01:00
zramSwap.enable = true;
2022-09-17 16:50:50 +02:00
boot.initrd.luks = {
fido2Support = true;
devices."root" = {
device = "/dev/disk/by-uuid/75eccc7f-30b0-4fe8-8f82-90edaf284cd5";
allowDiscards = true;
};
};
2022-11-06 12:51:43 +01:00
fileSystems."/" =
{ device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
};
2022-09-17 16:50:50 +02:00
fileSystems."/home" =
{ device = "/dev/mapper/root";
2022-09-17 16:50:50 +02:00
fsType = "btrfs";
2022-11-06 12:51:43 +01:00
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
2022-09-17 16:50:50 +02:00
};
2022-11-06 17:01:18 +01:00
fileSystems."/home/.snapshots" =
{ device = "/dev/mapper/root";
fsType = "btrfs";
2022-11-06 17:01:18 +01:00
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
};
2022-09-18 17:11:13 +02:00
fileSystems."/srv" =
{ device = "/dev/mapper/root";
2022-09-18 17:11:13 +02:00
fsType = "btrfs";
2022-11-06 12:51:43 +01:00
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
2022-09-18 17:11:13 +02:00
};
2022-11-06 17:01:18 +01:00
fileSystems."/opt" =
{ device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@opt,discard=async" ];
};
fileSystems."/nix" =
{ device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
};
2022-09-17 16:50:50 +02:00
fileSystems."/boot" =
{ device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
2022-11-02 15:10:28 +01:00
fileSystems."/mnt/Herkules" =
{ device = "truenas:/mnt/Herkules";
fsType = "nfs";
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec" ];
};
2022-11-06 12:51:43 +01:00
fileSystems."/mnt/Nova" =
{ device = "truenas:/mnt/Nova";
fsType = "nfs";
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec" ];
};
2022-11-02 15:10:28 +01:00
2022-09-17 16:50:50 +02:00
swapDevices = [ ];
2022-12-23 15:55:39 +01:00
2022-09-17 16:50:50 +02:00
networking = {
useDHCP = false; # Deprecated
hostName = "nbf5";
2022-10-24 20:26:01 +02:00
wireless.iwd.enable = true;
networkmanager = {
enable = true;
wifi = {
backend = "iwd";
powersave = true;
};
};
2022-09-17 16:50:50 +02:00
interfaces = {
2022-10-31 16:44:39 +01:00
wlan0 = {
2022-09-17 16:50:50 +02: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" ];
2022-12-23 15:55:39 +01:00
firewall = {
checkReversePath = "loose";
2022-09-17 16:50:50 +02:00
# enable = false;
# #allowedUDPPorts = [ 53 67 ];
# #allowedTCPPorts = [ 53 80 443 9443 ];
2022-12-23 15:55:39 +01:00
};
2022-09-17 16:50:50 +02:00
};
2022-09-18 14:33:58 +02:00
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
}