# # 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 + "/profiles/qemu-guest.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" "vfio_virqfd" ]; boot.initrd.secrets = { "/root/NASKeyfile" = /root/NASKeyfile; }; boot.initrd.luks.devices = { NAS-RAID1 = { device = "/dev/disk/by-uuid/57e6446d-faca-4b67-9063-e8d9afb80088"; keyFile = "/root/NASKeyfile"; }; NAS-RAID2 = { device = "/dev/disk/by-uuid/b9edc489-ac37-4b28-981d-442722df7ae2"; keyFile = "/root/NASKeyfile"; }; }; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; boot.tmpOnTmpfs = true; zramSwap.enable = true; services.btrfs.autoScrub = { enable = true; interval = "monthly"; fileSystems = [ "/" "/mnt/Pluto" # "/mnt/Mars" ]; }; services.btrbk = { instances = { hf = { settings = { incremental = yes; snapshot_create = "ondemand"; snapshot_dir = "/mnt/snapshots"; snapshot_preserve = "2m 2w 5d 5h"; snapshot_preserve_min = "latest"; onCalender = "hourly"; volume = { "/" = { snapshot_dir = /mnt/snapshots/root; snapshot_create = "always"; subvolume = "@home"; }; }; }; }; }; }; fileSystems."/" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ]; }; fileSystems."/home" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ]; }; fileSystems."/srv" = { device = "/dev/disk/by-label/NIXROOT"; 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" ]; }; fileSystems."/mnt/snapshots/root" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ]; }; fileSystems."/mnt/snapshots/Mars" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots/mars/home,discard=async" ]; }; fileSystems."/mnt/snapshots/Pluto" = { device = "/dev/disk/by-label/NAS-RAID"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots" ]; }; fileSystems."/mnt/Pluto" = { device = "/dev/disk/by-label/NAS-RAID"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,noatime,subvol=@" ]; }; fileSystems."/mnt/Mars" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "btrfs"; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nas,discard=async" ]; }; fileSystems."/boot" = { device = "/dev/disk/by-label/NIXBOOT"; fsType = "vfat"; }; fileSystems."/export/Pluto" = { device = "/mnt/Pluto"; options = [ "bind" ]; }; fileSystems."/export/Mars" = { device = "/mnt/Mars"; options = [ "bind" ]; }; swapDevices = [ ]; networking = { useDHCP = false; # Deprecated hostName = "nas"; domain = "home.opel-online.de"; networkmanager = { enable = false; }; interfaces = { enp0s31f6 = { useDHCP = true; # For versatility sake, manually edit IP on nm-applet. # ipv4.addresses = [ { # address = "45.142.114.153"; # prefixLength = 24; # } ]; # ipv6.addresses = [ { # address = "2a00:ccc1:101:19D::2"; # prefixLength = 64; # } ]; }; }; # defaultGateway = "45.142.114.1"; # defaultGateway6 = { # address = "fe80::1"; # interface = "ens18"; # }; # # nameservers = [ "9.9.9.9" "2620:fe::fe" ]; }; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; powerManagement = { cpuFreqGovernor = lib.mkDefault "powersave"; powertop.enable = true; powerUpCommands = '' ${pkgs.hdparm}/sbin/hdparm -S 150 /dev/disk/by-uuid/57e6446d-faca-4b67-9063-e8d9afb80088 ${pkgs.hdparm}/sbin/hdparm -S 150 /dev/disk/by-uuid/b9edc489-ac37-4b28-981d-442722df7ae2 ''; }; }