2023-07-21 22:07:21 +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-21 11:32:23 +01:00
|
|
|
|
boot = {
|
|
|
|
|
initrd = {
|
2024-06-21 23:15:02 +02:00
|
|
|
|
availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
|
2023-12-21 11:32:23 +01:00
|
|
|
|
kernelModules = [ ];
|
|
|
|
|
systemd.enable = true;
|
|
|
|
|
luks = {
|
|
|
|
|
devices."crypted" = {
|
|
|
|
|
device = "/dev/disk/by-partlabel/disk-nvme0n1-luks";
|
|
|
|
|
allowDiscards = true;
|
2024-04-20 14:17:30 +02:00
|
|
|
|
bypassWorkqueues = true;
|
2023-12-21 11:32:23 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-27 07:43:00 +01:00
|
|
|
|
kernelModules = [ "kvm-amd" "amdgpu" ];
|
2023-12-21 11:32:23 +01:00
|
|
|
|
kernelParams = [ "luks.options=fido2-device=auto" ];
|
|
|
|
|
tmp.useTmpfs = false;
|
|
|
|
|
tmp.cleanOnBoot = true;
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-23 09:19:56 +02:00
|
|
|
|
zramSwap.enable = true;
|
2023-07-23 20:12:02 +02:00
|
|
|
|
|
2023-12-27 07:49:24 +01:00
|
|
|
|
services = {
|
|
|
|
|
btrfs.autoScrub = {
|
|
|
|
|
enable = true;
|
|
|
|
|
interval = "monthly";
|
|
|
|
|
fileSystems = [
|
|
|
|
|
"/"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
udev.extraRules = ''
|
|
|
|
|
ACTION=="add", SUBSYSTEM=="block", KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_FS_USAGE}=="filesystem", RUN{program}+="${pkgs.systemd}/bin/systemd-mount -o noatime,compress-force=zstd:15,ssd_spread,commit=120 --no-block --automount=yes --collect $devnode /run/media/mmcblk0p1"
|
|
|
|
|
'';
|
2023-07-21 22:07:21 +02:00
|
|
|
|
|
2024-06-21 23:15:02 +02:00
|
|
|
|
btrbk = {
|
|
|
|
|
instances = {
|
|
|
|
|
hf = {
|
|
|
|
|
onCalendar = "hourly";
|
|
|
|
|
settings = {
|
|
|
|
|
incremental = "yes";
|
|
|
|
|
snapshot_create = "ondemand";
|
|
|
|
|
snapshot_dir = "@snapshots";
|
|
|
|
|
timestamp_format = "long";
|
2023-12-21 11:32:23 +01:00
|
|
|
|
|
2024-06-21 23:15:02 +02:00
|
|
|
|
snapshot_preserve = "2m 2w 5d 5h";
|
|
|
|
|
snapshot_preserve_min = "latest";
|
|
|
|
|
|
|
|
|
|
volume = {
|
|
|
|
|
"/mnt/snapshots/root" = {
|
|
|
|
|
snapshot_create = "always";
|
|
|
|
|
subvolume = {
|
|
|
|
|
"@home" = {};
|
|
|
|
|
};
|
2023-12-21 11:32:23 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-10-20 11:00:40 +02:00
|
|
|
|
# bak = {
|
|
|
|
|
# onCalendar = "daily";
|
|
|
|
|
# settings = {
|
|
|
|
|
# stream_buffer = "256m";
|
|
|
|
|
# stream_compress = "lz4";
|
|
|
|
|
# incremental = "yes";
|
|
|
|
|
# snapshot_create = "no";
|
|
|
|
|
# snapshot_dir = "@snapshots";
|
|
|
|
|
# timestamp_format = "long";
|
|
|
|
|
#
|
|
|
|
|
# snapshot_preserve_min = "all";
|
|
|
|
|
# target_preserve_min = "no";
|
|
|
|
|
# target_preserve = "2m 4w 3d";
|
|
|
|
|
#
|
|
|
|
|
# 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/@steamdeck";
|
|
|
|
|
# };
|
|
|
|
|
# };
|
|
|
|
|
# };
|
|
|
|
|
# };
|
2023-12-21 11:32:23 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-10-20 11:00:40 +02:00
|
|
|
|
#
|
|
|
|
|
# systemd.timers = {
|
|
|
|
|
# btrbk-bak = {
|
|
|
|
|
# requires = [ "network-online.target" ];
|
|
|
|
|
# };
|
|
|
|
|
# };
|
2023-07-21 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
fileSystems."/" =
|
2023-12-21 11:32:23 +01:00
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
|
2023-07-21 22:07:21 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/boot" =
|
|
|
|
|
{ device = "/dev/disk/by-label/NIXBOOT";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-21 11:32:23 +01:00
|
|
|
|
fileSystems."/home" =
|
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/nix" =
|
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/srv" =
|
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/swap" =
|
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@swap,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/opt" =
|
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@opt,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/mnt/snapshots/root" =
|
|
|
|
|
{ device = "/dev/mapper/crypted";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-27 07:49:24 +01:00
|
|
|
|
# fileSystems."/sdcard" =
|
|
|
|
|
# { device = "/dev/disk/by-label/sdcard";
|
|
|
|
|
# fsType = "ext4";
|
|
|
|
|
# options = [ "nofail,noauto,users,x-systemd.automount" ];
|
|
|
|
|
# };
|
2023-07-21 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
fileSystems."/mnt/Pluto" =
|
2023-10-02 10:25:09 +02:00
|
|
|
|
{ device = "jupiter:/Pluto";
|
2023-07-21 22:07:21 +02:00
|
|
|
|
fsType = "nfs";
|
2023-07-23 20:12:02 +02:00
|
|
|
|
options = [ "nofail,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-07-21 22:07:21 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/mnt/Mars" =
|
2023-09-03 19:39:29 +02:00
|
|
|
|
{ device = "jupiter:/Mars";
|
2023-07-21 22:07:21 +02:00
|
|
|
|
fsType = "nfs";
|
2023-07-23 20:12:02 +02:00
|
|
|
|
options = [ "nofail,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-07-21 22:07:21 +02:00
|
|
|
|
};
|
|
|
|
|
|
2023-12-21 11:32:23 +01:00
|
|
|
|
|
|
|
|
|
swapDevices = [ { device = "/swap/swapfile"; } ];
|
2023-07-21 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
useDHCP = false; # Deprecated
|
2023-12-21 11:32:23 +01:00
|
|
|
|
hostName = "steamdeck";
|
2023-07-21 22:07:21 +02:00
|
|
|
|
wireless.iwd.enable = true;
|
|
|
|
|
networkmanager = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wifi = {
|
|
|
|
|
backend = "iwd";
|
2024-03-28 22:24:16 +01:00
|
|
|
|
powersave = false;
|
2023-07-21 22:07:21 +02:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
# interfaces = {
|
|
|
|
|
# wlan0 = {
|
|
|
|
|
# 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" ];
|
|
|
|
|
firewall = {
|
|
|
|
|
checkReversePath = "loose";
|
2024-06-29 07:20:28 +02:00
|
|
|
|
enable = true;
|
|
|
|
|
allowedUDPPorts = [ 24727 ];
|
|
|
|
|
allowedTCPPorts = [ 24727 ];
|
2023-07-21 22:07:21 +02:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
2023-12-21 11:32:23 +01:00
|
|
|
|
#powerManagement.powertop.enable = true;
|
|
|
|
|
powerManagement = {
|
|
|
|
|
scsiLinkPolicy = "med_power_with_dipm";
|
|
|
|
|
};
|
2023-07-21 22:07:21 +02:00
|
|
|
|
}
|