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

160 lines
4.4 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;
};
};
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [
"/"
];
};
services.snapper.configs = {
home = {
subvolume = "/home";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
};
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";
};
2023-01-13 15:35:07 +01:00
fileSystems."/mnt/Pluto" =
{ device = "nas:/Pluto";
2022-11-02 15:10:28 +01:00
fsType = "nfs";
2023-01-13 15:35:07 +01:00
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" ];
2022-11-02 15:10:28 +01:00
};
2023-01-13 15:35:07 +01:00
fileSystems."/mnt/Mars" =
{ device = "nas:/Mars";
2022-11-06 12:51:43 +01:00
fsType = "nfs";
2023-01-13 15:35:07 +01:00
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" ];
2022-11-06 12:51:43 +01:00
};
2023-01-13 15:35:07 +01:00
# 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-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;
2023-01-08 13:26:55 +01:00
powerManagement = {
cpuFreqGovernor = lib.mkDefault "powersave";
powertop.enable = true;
};
2022-09-18 14:33:58 +02:00
}