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")
|
|
|
|
|
];
|
|
|
|
|
|
2023-12-18 16:00:19 +01:00
|
|
|
|
boot = {
|
|
|
|
|
initrd = {
|
|
|
|
|
availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" "rtsx_usb_sdmmc" ];
|
|
|
|
|
kernelModules = [ "i915" "kvm_intel" ];
|
|
|
|
|
systemd.enable = true;
|
|
|
|
|
luks = {
|
|
|
|
|
devices."root" = {
|
|
|
|
|
device = "/dev/disk/by-uuid/75eccc7f-30b0-4fe8-8f82-90edaf284cd5";
|
|
|
|
|
allowDiscards = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2022-09-17 16:50:50 +02:00
|
|
|
|
|
2023-12-18 16:00:19 +01:00
|
|
|
|
kernelModules = [ "kvm-intel" ];
|
|
|
|
|
extraModprobeConfig = ''
|
|
|
|
|
options i915 enable_guc=3 enable_fbc=1 fastboot=1
|
|
|
|
|
'';
|
|
|
|
|
kernelParams = [ "mitigations=off" "luks.options=fido2-device=auto" ];
|
|
|
|
|
tmp.useTmpfs = true;
|
2022-10-01 14:01:15 +02:00
|
|
|
|
};
|
2022-09-29 20:42:31 +02:00
|
|
|
|
|
2023-12-18 16:00:19 +01:00
|
|
|
|
zramSwap.enable = true;
|
|
|
|
|
|
2023-01-13 17:21:18 +01:00
|
|
|
|
services.btrfs.autoScrub = {
|
|
|
|
|
enable = true;
|
|
|
|
|
interval = "monthly";
|
|
|
|
|
fileSystems = [
|
|
|
|
|
"/"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-15 19:12:35 +01:00
|
|
|
|
services.btrbk = {
|
|
|
|
|
instances = {
|
|
|
|
|
hf = {
|
|
|
|
|
onCalendar = "hourly";
|
|
|
|
|
settings = {
|
|
|
|
|
incremental = "yes";
|
|
|
|
|
snapshot_create = "ondemand";
|
|
|
|
|
snapshot_dir = "@snapshots";
|
|
|
|
|
timestamp_format = "long";
|
|
|
|
|
|
|
|
|
|
snapshot_preserve = "2m 2w 5d 5h";
|
|
|
|
|
snapshot_preserve_min = "latest";
|
|
|
|
|
|
|
|
|
|
volume = {
|
|
|
|
|
"/mnt/snapshots/root" = {
|
|
|
|
|
snapshot_create = "always";
|
|
|
|
|
subvolume = {
|
|
|
|
|
"@home" = {};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-01-13 17:21:18 +01:00
|
|
|
|
};
|
|
|
|
|
|
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" =
|
2022-09-29 20:42:31 +02:00
|
|
|
|
{ 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-09-18 17:11:13 +02:00
|
|
|
|
fileSystems."/srv" =
|
2022-09-29 20:42:31 +02:00
|
|
|
|
{ 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" ];
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-15 19:12:35 +01:00
|
|
|
|
fileSystems."/mnt/snapshots/root" =
|
2023-01-15 19:39:22 +01:00
|
|
|
|
{ device = "/dev/mapper/root";
|
2023-01-15 19:12:35 +01:00
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
2022-09-17 16:50:50 +02:00
|
|
|
|
fileSystems."/boot" =
|
|
|
|
|
{ device = "/dev/disk/by-label/BOOT";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
|
|
|
|
|
2023-04-01 10:16:17 +02:00
|
|
|
|
fileSystems."/mnt/Pluto" =
|
2023-10-02 10:25:09 +02:00
|
|
|
|
{ device = "jupiter:/Pluto";
|
2023-04-01 10:16:17 +02: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" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/mnt/Mars" =
|
2023-09-03 19:39:29 +02:00
|
|
|
|
{ device = "jupiter:/Mars";
|
2023-04-01 10:16:17 +02: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" ];
|
|
|
|
|
};
|
2022-11-06 12:51:43 +01:00
|
|
|
|
|
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;
|
2023-01-08 13:26:55 +01:00
|
|
|
|
powerManagement = {
|
2023-03-21 17:33:50 +01:00
|
|
|
|
cpuFreqGovernor = lib.mkDefault "schedutil";
|
2023-01-08 13:26:55 +01:00
|
|
|
|
powertop.enable = true;
|
|
|
|
|
};
|
2022-09-18 14:33:58 +02:00
|
|
|
|
}
|