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 =
|
|
|
|
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
|
];
|
|
|
|
|
|
2022-11-05 14:50:15 +01:00
|
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
2022-11-05 10:25:12 +01:00
|
|
|
|
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" "vfio_virqfd" ];
|
2022-11-05 14:50:15 +01:00
|
|
|
|
boot.kernelModules = [ "kvm-amd" ];
|
2022-11-05 10:25:12 +01:00
|
|
|
|
boot.extraModulePackages = [ ];
|
2023-01-07 08:38:47 +01:00
|
|
|
|
boot.tmpOnTmpfs = true;
|
2023-01-07 08:56:04 +01:00
|
|
|
|
zramSwap.enable = true;
|
2022-11-05 10:25:12 +01:00
|
|
|
|
|
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-05 10:25:12 +01:00
|
|
|
|
fileSystems."/" =
|
2022-11-05 14:50:15 +01:00
|
|
|
|
{ device = "/dev/disk/by-label/NIXROOT";
|
2022-11-05 10:25:12 +01:00
|
|
|
|
fsType = "btrfs";
|
2022-11-06 12:50:20 +01:00
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
|
2022-11-05 10:25:12 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/home" =
|
2022-11-05 14:50:15 +01:00
|
|
|
|
{ device = "/dev/disk/by-label/NIXROOT";
|
2022-11-05 10:25:12 +01:00
|
|
|
|
fsType = "btrfs";
|
2022-11-06 12:50:20 +01:00
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
2022-11-05 10:25:12 +01:00
|
|
|
|
fileSystems."/srv" =
|
2022-11-05 14:50:15 +01:00
|
|
|
|
{ device = "/dev/disk/by-label/NIXROOT";
|
2022-11-05 10:25:12 +01:00
|
|
|
|
fsType = "btrfs";
|
2022-11-06 12:50:20 +01:00
|
|
|
|
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" ];
|
2022-11-05 10:25:12 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-01-15 19:12:35 +01:00
|
|
|
|
fileSystems."/mnt/snapshots/root" =
|
|
|
|
|
{ device = "/dev/disk/by-label/NIXROOT";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
2022-11-05 10:25:12 +01:00
|
|
|
|
fileSystems."/boot" =
|
2022-11-05 14:50:15 +01:00
|
|
|
|
{ device = "/dev/disk/by-label/NIXBOOT";
|
2022-11-05 10:25:12 +01:00
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-07 19:43:12 +01:00
|
|
|
|
fileSystems."/mnt/Pluto" =
|
2023-01-07 20:09:37 +01:00
|
|
|
|
{ device = "nas:/Pluto";
|
2023-01-07 19:43:12 +01:00
|
|
|
|
fsType = "nfs";
|
2023-01-07 20:09:37 +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" ];
|
2023-01-07 19:43:12 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-01-08 12:29:50 +01:00
|
|
|
|
fileSystems."/mnt/Mars" =
|
|
|
|
|
{ device = "nas:/Mars";
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
swapDevices = [ ];
|
|
|
|
|
|
|
|
|
|
networking = {
|
2023-01-28 17:40:29 +01:00
|
|
|
|
vswitches = {
|
|
|
|
|
vs0 = {
|
|
|
|
|
interfaces = {
|
|
|
|
|
enp34s0 = { };
|
|
|
|
|
lo1 = {
|
|
|
|
|
type = "internal";
|
|
|
|
|
};
|
2023-01-28 21:24:46 +01:00
|
|
|
|
#enp34s0iot = {
|
|
|
|
|
# type = "internal";
|
|
|
|
|
# vlan = 100;
|
|
|
|
|
#};
|
2023-01-28 17:40:29 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2022-11-05 10:25:12 +01:00
|
|
|
|
useDHCP = false; # Deprecated
|
2023-01-28 17:40:29 +01:00
|
|
|
|
hostName = "hades";
|
2023-01-21 19:02:08 +01:00
|
|
|
|
domain = "home.opel-online.de";
|
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
|
|
|
|
};
|
2023-01-21 19:02:08 +01:00
|
|
|
|
timeServers = [
|
|
|
|
|
"192.168.2.1"
|
|
|
|
|
];
|
2022-11-05 10:25:12 +01:00
|
|
|
|
interfaces = {
|
2023-01-28 17:40:29 +01:00
|
|
|
|
#enp34s0 = {
|
|
|
|
|
# useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
|
|
|
|
|
# #ipv4.addresses = [ {
|
|
|
|
|
# # address = "192.168.0.51";
|
|
|
|
|
# # prefixLength = 24;
|
|
|
|
|
# #} ];
|
|
|
|
|
#};
|
|
|
|
|
#enp34s0iot.useDHCP = true;
|
2023-01-28 21:24:46 +01:00
|
|
|
|
lo1 = {
|
|
|
|
|
useDHCP = true;
|
|
|
|
|
macAddress = "1a:20:e9:ce:9c:1a";
|
|
|
|
|
};
|
2022-11-05 10:25:12 +01:00
|
|
|
|
};
|
|
|
|
|
#defaultGateway = "192.168.0.1";
|
2023-01-21 19:02:08 +01:00
|
|
|
|
defaultGateway6 = {
|
|
|
|
|
address = "fe80::1";
|
2023-01-28 17:40:29 +01:00
|
|
|
|
interface = "lo1";
|
2023-01-21 19:02:08 +01:00
|
|
|
|
};
|
2022-11-05 10:25:12 +01:00
|
|
|
|
#nameservers = [ "192.168.0.4" ];
|
|
|
|
|
#firewall = {
|
|
|
|
|
# enable = false;
|
|
|
|
|
# #allowedUDPPorts = [ 53 67 ];
|
|
|
|
|
# #allowedTCPPorts = [ 53 80 443 9443 ];
|
|
|
|
|
#};
|
|
|
|
|
};
|
|
|
|
|
|
2022-11-05 14:50:15 +01:00
|
|
|
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
2022-11-05 10:25:12 +01:00
|
|
|
|
# high-resolution display
|
|
|
|
|
hardware.video.hidpi.enable = lib.mkDefault true;
|
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
|
|
|
|
}
|