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

186 lines
5.6 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 =
2023-10-29 09:46:49 +01:00
[ (modulesPath + "/installer/scan/not-detected.nix")] ++
[( import ../../modules/hardware/backup.nix )];
2022-11-05 10:25:12 +01:00
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" ];
2024-12-07 22:52:18 +01:00
boot.kernelModules = [ "kvm-amd" "nct6775" ];
2022-11-05 10:25:12 +01:00
boot.extraModulePackages = [ ];
2023-09-22 19:22:19 +02:00
boot.tmp.useTmpfs = false;
boot.tmp.cleanOnBoot = true;
2023-01-07 08:56:04 +01:00
zramSwap.enable = true;
2022-11-05 10:25:12 +01:00
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [
"/"
];
};
2023-01-15 19:12:35 +01:00
services.btrbk = {
2024-10-14 17:46:26 +02:00
extraPackages = [ pkgs.lz4 pkgs.mbuffer ];
2023-01-15 19:12:35 +01:00
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" = {};
};
};
};
};
};
2024-10-14 12:17:17 +02:00
bak = {
onCalendar = "daily";
settings = {
2024-10-14 17:46:26 +02:00
stream_buffer = "256m";
2024-10-14 12:17:17 +02:00
stream_compress = "lz4";
incremental = "yes";
snapshot_create = "no";
snapshot_dir = "@snapshots";
timestamp_format = "long";
snapshot_preserve_min = "all";
target_preserve_min = "no";
2024-10-19 08:43:49 +02:00
target_preserve = "2m 4w 3d";
2024-10-14 12:17:17 +02:00
ssh_identity = "/etc/btrbk/ssh/id_ed25519_btrbk_nas";
ssh_user = "btrbk";
volume = {
"/mnt/snapshots/root" = {
subvolume = {
"@home" = {};
};
target = "ssh://jupiter.home.opel-online.de:2220/mnt/snapshots/Mars/@snapshots/@hades";
};
};
};
};
2023-01-15 19:12:35 +01:00
};
};
systemd.timers = {
2024-10-19 08:43:49 +02:00
btrbk-bak = {
requires = [ "network-online.target" ];
2024-10-19 08:43:49 +02:00
};
};
2022-11-05 10:25:12 +01:00
fileSystems."/" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part2";
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" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part2";
2022-11-05 10:25:12 +01:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
};
2022-11-05 10:25:12 +01:00
fileSystems."/srv" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part2";
2022-11-05 10:25:12 +01:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
};
fileSystems."/nix" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part2";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
2022-11-05 10:25:12 +01:00
};
2023-09-22 19:22:19 +02:00
fileSystems."/swap" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part2";
2023-09-22 19:22:19 +02:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@swap,discard=async" ];
};
2023-01-15 19:12:35 +01:00
fileSystems."/mnt/snapshots/root" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part2";
2023-01-15 19:12:35 +01:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
2022-11-05 10:25:12 +01:00
fileSystems."/boot" =
2023-11-19 14:14:52 +01:00
{ device = "/dev/disk/by-id/nvme-ADATA_SX8200PNP_2J3320119186-part1";
2022-11-05 10:25:12 +01:00
fsType = "vfat";
};
2023-01-07 19:43:12 +01:00
fileSystems."/mnt/Pluto" =
{ device = "jupiter:/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" =
2023-09-03 19:39:29 +02:00
{ device = "jupiter:/Mars";
2023-01-08 12:29:50 +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" ];
};
2022-11-05 10:25:12 +01:00
2023-09-22 19:22:19 +02:00
swapDevices = [ { device = "/swap/swapfile"; } ];
2022-11-05 10:25:12 +01:00
networking = {
useDHCP = false; # Deprecated
2023-01-28 17:40:29 +01:00
hostName = "hades";
2022-11-05 10:25:12 +01:00
networkmanager = {
2023-01-28 21:24:46 +01:00
enable = false;
2022-11-05 10:25:12 +01:00
};
2024-06-29 07:20:28 +02:00
firewall = {
enable = true;
allowedUDPPorts = [ 24727 ];
allowedTCPPorts = [ 24727 ];
};
2022-11-05 10:25:12 +01:00
};
systemd.network = {
enable = true;
networks = {
"10-lan" = {
matchConfig.Name = "eno1";
ntp = [ "192.168.2.1" ];
domains = [ "home.opel-online.de" ];
networkConfig = {
DHCP = "yes";
IPv6AcceptRA = true;
};
};
};
};
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
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
}