From 3391330bb14dd09978d3d2d730783f4b20fc1246 Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 6 Feb 2024 20:11:28 +0900 Subject: [PATCH] test --- nixos/hosts/nixos-framework/disks.nix | 29 ++++++++++----------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/nixos/hosts/nixos-framework/disks.nix b/nixos/hosts/nixos-framework/disks.nix index c3ed2668..3f4e531c 100644 --- a/nixos/hosts/nixos-framework/disks.nix +++ b/nixos/hosts/nixos-framework/disks.nix @@ -1,9 +1,15 @@ { + + imports = [ ../../common/services/snapper.nix ]; services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; + boot.resumeDevice = "/dev/disk/by-partlabel/ROOT"; + # boot.kernelParams = [ "resume_offset=[offset]" ]; + # https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/ + disko.devices.disk.nvme0 = { device = "/dev/nvme0n1"; content = { @@ -32,7 +38,6 @@ content = { type = "luks"; name = "ROOT"; - settings.preLVM = true; extraOpenArgs = [ "--allow-discards" ]; content = { type = "btrfs"; @@ -63,27 +68,15 @@ mountpoint = "/nix/.snapshots"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix + # Swap partition + "/swap" = { + mountpoint = "/swap"; + swap.swapfile.size = "64G"; + }; # swap }; # subvolumes }; # content.content }; # content } # partition 2 (/ BTRFS) - { - name = "LUKS-SWAP"; - start = "-64GiB"; - end = "100%"; - content = { - type = "luks"; - name = "SWAP"; - settings = { - allowDiscards = true; - keyFile = "/mnt-root/etc/swap.key"; - }; # content - content = { - type = "swap"; - resumeDevice = true; # Hibernation - }; # content.ontent - };# content - } # partition 3 (SWAP) ]; # partitions }; # content }; # disko.devices.disk.nvme0