From 1a6d414243c6ee77f322e394869dfebf31cc0f91 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Fri, 28 Jan 2022 14:38:47 +0100 Subject: [PATCH] many trantor changes --- capibara.nix | 11 ++++++ home/trantor.nix | 52 ++++++++++++++++++++++++++++ trantor.nix | 88 ++++++++++++++++++++++++++++++------------------ 3 files changed, 118 insertions(+), 33 deletions(-) diff --git a/capibara.nix b/capibara.nix index df49839..3c235ab 100644 --- a/capibara.nix +++ b/capibara.nix @@ -60,6 +60,17 @@ in { options = [ "subvol=swap" ]; }; + "/home/rilla/Music" = { + device = "narwhal:/music"; + fsType = "nfs"; + options = [ + "nfsvers=4" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=1min" + ]; + }; + }; swapDevices = [{ device = "/swap/swapfile"; }]; diff --git a/home/trantor.nix b/home/trantor.nix index 95ad78d..afafe64 100644 --- a/home/trantor.nix +++ b/home/trantor.nix @@ -46,6 +46,58 @@ in { ./zsh ]; + home.persistence."/persist/system/${config.home.homeDirectory}" = { + directories = [ + ".abook" + ".bitmonero" + ".cache" + ".config/Nextcloud" + ".config/chromium" + ".config/whatsapp-for-linux" + ".gnupg/private-keys-v1.d" + ".local/share/keyrings" + ".local/share/mpd" + ".local/share/webkitgtk" + ".mozilla" + ".newsboat" + ".vdirsyncer" + ]; + files = [ + ".gnupg/pubring.kbx" + ".gnupg/trustdb.gpg" + ".mailsynclastrun" + ".ssh/known_hosts" + ".zsh_history" + ]; + allowOther = true; + }; + + home.persistence."/persist/user/${config.home.homeDirectory}" = { + directories = [ + ".config/Signal" + ".config/Element" + ".local/share/TelegramDesktop" + ".local/share/dino" + ".local/share/Bisq" + ".password-store" + ".walletwasabi" + "Calendars" + "Contacts" + "Documents" + "Downloads" + "Images" + "Maildir" + "Monero" + "Nextcloud" + "code" + "configs" + "misc" + "workspace" + ]; + files = [ ]; + allowOther = true; + }; + home.sessionVariables = { EDITOR = "${pkgs.neovim}/bin/nvim"; VISUAL = "${pkgs.neovim}/bin/nvim"; diff --git a/trantor.nix b/trantor.nix index 515e116..ad55e92 100644 --- a/trantor.nix +++ b/trantor.nix @@ -24,27 +24,35 @@ in { fileSystems = { "/" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "defaults" "size=2G" "mode=755" ]; + }; + + "/persist/system" = { device = "/dev/mapper/system"; fsType = "btrfs"; - options = [ "subvol=root" "compress-force=zstd" ]; + options = [ "subvol=persist" "compress=zstd" ]; + neededForBoot = true; + }; + + "/persist/user" = { + device = "/dev/mapper/user"; + fsType = "btrfs"; + options = [ "subvol=persist" "compress=zstd" ]; + neededForBoot = true; }; "/nix" = { device = "/dev/mapper/system"; fsType = "btrfs"; - options = [ "subvol=nix" "compress-force=zstd" ]; + options = [ "subvol=nix" "compress=zstd" ]; }; - "/var/log" = { + "/boot" = { device = "/dev/mapper/system"; fsType = "btrfs"; - options = [ "subvol=log" "compress-force=zstd" ]; - }; - - "/home" = { - device = "/dev/mapper/user"; - fsType = "btrfs"; - options = [ "subvol=home" "compress-force=zstd" ]; + options = [ "subvol=boot" "compress=zstd" ]; }; "/boot/efi" = { @@ -52,28 +60,21 @@ in { fsType = "vfat"; }; - "/home/rilla/Maildir" = { - device = "/dev/mapper/user"; - fsType = "btrfs"; - options = [ "subvol=mail" "compress-force=zstd" ]; - }; - "/swap" = { device = "/dev/mapper/system"; fsType = "btrfs"; options = [ "subvol=swap" ]; }; - # "/home/rilla/music" = { - # device = "narwhal:/music"; - # fsType = "nfs"; - # options = [ - # "nfsvers=4" - # "noauto" - # "x-systemd.automount" - # "x-systemd.idle-timeout=1min" - # ]; - # }; + "/home/rilla/music" = { + device = "narwhal:/music"; + fsType = "nfs"; + options = [ + "nfsvers=4" + "x-systemd.automount" + "x-systemd.idle-timeout=1min" + ]; + }; # "/home/rilla/calibre" = { # device = "narwhal:/calibre"; @@ -89,11 +90,32 @@ in { swapDevices = [{ device = "/swap/swapfile"; }]; - environment.variables = { - NIXOS_CONFIG = "/home/rilla/configs/nix-config/trantor.nix"; - WINT_HDPI_FACTOR = "1"; + environment.persistence = { + "/persist/system" = { + directories = [ + "/var/log" + "/var/lib/bluetooth" + "/var/lib/systemd/coredump" + "/var/lib/docker" + ]; + files = [ + "/etc/machine-id" + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + # "/etc/wireguard/wg0" + ]; + }; + "/persist/user" = { + directories = + [ "/etc/NetworkManager/system-connections" "/var/lib/libvirt" ]; + }; }; + environment.variables.NIXOS_CONFIG = + "/home/rilla/configs/nix-config/trantor.nix"; + networking.networkmanager.wifi.macAddress = "80:FA:5B:41:12:0F"; nixpkgs.config.allowUnfree = true; @@ -118,16 +140,16 @@ in { luks.devices = { "system" = { device = "/dev/disk/by-uuid/b9778e01-a86c-4c6b-beb3-f97888d4a6eb"; - keyFile = "/root_keyfile.bin"; + keyFile = "/system_keyfile.bin"; }; "user" = { device = "/dev/disk/by-uuid/d8e9b35d-704a-4f66-bc19-0dd3e158de36"; - keyFile = "/home_keyfile.bin"; + keyFile = "/user_keyfile.bin"; }; }; secrets = { - "/root_keyfile.bin" = "/boot/system_keyfile.bin"; - "/home_keyfile.bin" = "/boot/user_keyfile.bin"; + "/system_keyfile.bin" = "/boot/system_keyfile.bin"; + "/user_keyfile.bin" = "/boot/user_keyfile.bin"; }; }; };