about summary refs log tree commit diff
path: root/users/tazjin/nixos/tverskoy
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-03-21T00·36+0200
committertazjin <mail@tazj.in>2021-03-21T00·55+0000
commite653366153b12be4b1ce4a4ad2d992cd46f2c763 (patch)
tree97fce0e5c9326345bef62165e0c18dc824b9bc61 /users/tazjin/nixos/tverskoy
parent6e94b3ca2fc18102f46ea6357f7b11235ed3ce63 (diff)
feat(tazjin/tverskoy): Configure impermanence module r/2300
This module is responsible for mounting persistent storage into the
ephemeral root disk of this machine.

Currently only very basic configuration and data are retained, and
hopefully that won't change.

Change-Id: If800cbee60b7b3c5b8c457b9b332a0c05c33f20e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2621
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/nixos/tverskoy')
-rw-r--r--users/tazjin/nixos/tverskoy/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/users/tazjin/nixos/tverskoy/default.nix b/users/tazjin/nixos/tverskoy/default.nix
index 74c676f4e3f1..3c4b9dae1184 100644
--- a/users/tazjin/nixos/tverskoy/default.nix
+++ b/users/tazjin/nixos/tverskoy/default.nix
@@ -17,6 +17,10 @@ config: let
     monolithic = false;
   };
 in lib.fix(self: {
+  imports = [
+    "${depot.third_party.impermanence}/nixos.nix"
+  ];
+
   boot = {
     initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
     initrd.kernelModules = [ ];
@@ -52,6 +56,7 @@ in lib.fix(self: {
     "/persist" = {
       device = "zpool/safe/persist";
       fsType = "zfs";
+      neededForBoot = true;
     };
 
     "/boot" = {
@@ -98,6 +103,18 @@ in lib.fix(self: {
     };
   };
 
+  environment.persistence."/persist" = {
+    directories = [
+      "/var/log"
+      "/var/lib/bluetooth"
+      "/var/lib/systemd/coredump"
+      "/etc/NetworkManager/system-connections"
+    ];
+    files = [
+      "/etc/machine-id"
+    ];
+  };
+
   security.rtkit.enable = true;
   services = {
     pipewire = {