From ed005e78813d5c02256301aa36192114f528b613 Mon Sep 17 00:00:00 2001 From: Till Date: Wed, 10 Jul 2024 16:57:40 +0200 Subject: [PATCH] prepare tron --- flake.nix | 16 ++++++++++- home/fish.nix | 4 +-- home/mail/default.nix | 2 +- system/hardware-tron.nix | 62 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 system/hardware-tron.nix diff --git a/flake.nix b/flake.nix index aefffab..c0eaf0b 100644 --- a/flake.nix +++ b/flake.nix @@ -23,9 +23,23 @@ ./system/btrbk.nix ./system/yubikey.nix ./system/alt.nix - ./system/lisa.nix ]; }; + + tron = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + { + networking.hostName = "tron"; + } + ./system + ./system/hardware-tron.nix + ./system/gnome.nix + ./system/btrbk.nix + ./system/yubikey.nix + ]; + }; + romulus = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ diff --git a/home/fish.nix b/home/fish.nix index 7b32284..99af83b 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -4,7 +4,7 @@ top = "btm --battery"; linkbox = "ln -s (pwd) ~/box/"; rloft = "tmux source-file ~/.config/tmux/rloft.conf"; - liftbox = "rsync -vaL --delete ~/box/ tstraube@login.server.uni-frankfurt.de:box/"; + liftbox = "ssh tstraube@login.server.uni-frankfurt.de \"rm -r box/*\" && scp -vr ~/box/ tstraube@login.server.uni-frankfurt.de:box/"; ktiubox = "rsync -vaL --delete ~/box/ root@ktiu.net:/var/www/html/box/"; ymd = "date +'%Y-%m-%d'"; pulluni = "ssh tstraube@login.server.uni-frankfurt.de \"cd uni-tstraube && git pull\""; @@ -20,7 +20,7 @@ showc = "chromium-browser -app=https://user.uni-frankfurt.de/~tstraube/c/"; castget = "castget -prvC ~/.config/castget/castget.conf"; castsync = "rsync -va --remove-source-files --progress --stats ~/.local/share/podcasts/ /run/media/till/CLIP\\ JAM/Podcasts/"; - musicsync = "rsync -va --progress --stats ~/media/music/sync/ /run/media/till/CLIP\\ JAM/Music/"; + musicsync = "rsync -va --ignore-existing --progress --stats ~/media/music/sync/ /run/media/till/CLIP\\ JAM/Music/"; cb = "cd $(sed 's|^file://||' /home/till/.config/gtk-3.0/bookmarks | fzf --height 10% --reverse)"; univpn = "secret-tool lookup server uni-frankfurt.de account tstraube | sudo openconnect --config=/home/till/.config/openconnect/config --passwd-on-stdin"; v = "nvim"; diff --git a/home/mail/default.nix b/home/mail/default.nix index 30c355e..4898270 100644 --- a/home/mail/default.nix +++ b/home/mail/default.nix @@ -147,7 +147,7 @@ set mbox='+Erledigt' set my_junk='+Junk' set postponed='+Drafts' - set record='+Gesendet' + set record='+Sent' set trash='+Trash' set crypt_auto_pgp unset crypt_auto_smime diff --git a/system/hardware-tron.nix b/system/hardware-tron.nix new file mode 100644 index 0000000..7b45ba0 --- /dev/null +++ b/system/hardware-tron.nix @@ -0,0 +1,62 @@ +{ config, lib, pkgs, modulesPath, ... }: + +let + subvolume = { + # device = "/dev/disk/by-uuid/6a0d25d4-0253-4467-85cc-ab3e0ef71f54"; + fsType = "btrfs"; + }; +in + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" "v4l2loopback" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; + + boot.initrd.luks.devices."cryptroot" = { + # device = "/dev/disk/by-uuid/eaad533f-8586-4002-9c53-5aecf8e7abd8"; + allowDiscards = true; + }; + + fileSystems."/" = subvolume // { + options = [ "subvol=root" "compress=zstd" "discard=async" ]; + }; + + # the following subvolumes are automatically mounted and won't be snapshotted: + # /home/till/.local/share/Steam + # /home/till/.local/share/Trash + # /home/till/.cache + # /home/till/tmp + # /home/till/.mozilla/firefox/till/storage + # /home/till/.config/Mattermost/Cache + # /home/till/.config/Mattermost/Code\ Cache + + fileSystems."/nix" = subvolume // { + options = [ "subvol=nix" "compress=zstd" "noatime" "discard=async" ]; + }; + + fileSystems."/home" = subvolume // { + options = [ "subvol=home" "compress=zstd" "discard=async" ]; + }; + + fileSystems."/boot" = { + # device = "/dev/disk/by-uuid/7362-C4C4"; + fsType = "vfat"; + }; + + swapDevices = [{ + device = "/swapfile"; + size = 8 * 1045; + }]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.trackpoint.enable = true; + boot.kernelParams = [ "psmouse.elantech_smbus=0" ]; + +}