!JQvnJacrwKgtkGHYHO:matrix.org

NixOS + Framework

225 Members
Discussing NixOS in the context of the Framework laptop50 Servers

Load older messages


SenderMessageTime
10 May 2026
@albertlarsan68:albertlarsan.frAlbert LarsanIf you can manage to navigate the mess that are my dotfiles, you can look at the spruce-frame host at https://git.sr.ht/~albertlarsan68/dotfiles TMDU: The disk is crypted by luks. Inside luks there is a lvm PV. The VG contains two LVs: A 64-gig swap (for hibernation) and the rest is my btrfs volume. Standard-ish Impermanence setup, just made sure that the script that cleans up the root only runs once resume has been attempted.13:49:03
@sudoforge:matrix.orgsudoforgeah, fair. hibernation on a zvol is a bad idea (although technically still... possible)13:52:06
@sudoforge:matrix.orgsudoforgeyou'd just need to patch the kernel to address the missing support :P13:53:05
@sudoforge:matrix.orgsudoforge are you using disko to configure your disk, by chance? 13:54:07
@sudoforge:matrix.orgsudoforge * 13:57:30
@rajil:rajils.comtrumeeno i am not using disko atm. 14:00:11
@rajil:rajils.comtrumeeI am currently using ZFS, but planning to migrate since i need hibernation.14:00:51
@sudoforge:matrix.orgsudoforge well, the good news is that a separate swap partition would work fine, and can be encrypted (if you do that), so you can continue using ZFS as your main filesystem. 14:05:07
@albertlarsan68:albertlarsan.frAlbert LarsanNote that having multiple LUKS containers on a single system has… complications.14:06:01
@sudoforge:matrix.orgsudoforge others have already addressed what you need to do, but i'd be happy to provide additional clarification if needed. 14:06:00
@sudoforge:matrix.orgsudoforge i haven't found that to be the case at all. 14:06:35
@albertlarsan68:albertlarsan.frAlbert LarsanI have auto-unlock with TPM on my server machines, and getting that to behave was a journey14:07:22
@sudoforge:matrix.orgsudoforge i have passphrase fallback, and use clevis + tang for my servers. 14:08:11
@albertlarsan68:albertlarsan.frAlbert LarsanAnd typing two unlock passphrases at boot is annoying too (especially on a laptop)14:08:31
@sudoforge:matrix.orgsudoforge you only need to do that if the passphrase differs. 14:08:54
@albertlarsan68:albertlarsan.frAlbert LarsanHaving swap and storage live in the same lvm vg is nice to be able to modulate size between the two without having to resize the luks containers (which is a royal pain IME)14:11:37
@albertlarsan68:albertlarsan.frAlbert LarsanI was trying to unlock a data disk with a keyfile on the main (tpm-unlocked) disk, but I abandonned this and went to unlock both disks with the tpm instead.14:12:41
@sudoforge:matrix.orgsudoforgeah, neat. my servers all have passphrase fallback, which i can administer through IMPI, but primarily boot and decrypt the disks using clevis and tang, requiring 2 of 2: TPM, and the tang server14:14:27
@sudoforge:matrix.orgsudoforge * 14:15:45
@albertlarsan68:albertlarsan.frAlbert LarsanI use laptops for servers, so no IPMI. There is ssh-based passphrase fallback, but it requires me to notice that the host is down, find a way to connect to its initrd ssh, and remember the correct command to ask systemd to prompt me the password.14:15:52
@albertlarsan68:albertlarsan.frAlbert LarsanI use systemd-crypt{setup,enroll}, not clevis though14:16:57
@rajil:rajils.comtrumeeI am not sure if hibernate is safe with zfs, https://github.com/openzfs/zfs/issues/1284214:18:20
@rajil:rajils.comtrumeealso, https://github.com/NixOS/nixpkgs/blob/93de6bf9ed923bf2d0991db61c2fd127f6e984ae/nixos/modules/tasks/filesystems/zfs.nix#L229-L23614:20:12
@albertlarsan68:albertlarsan.frAlbert LarsanI never got a file-based hibernation working on btrfs, that is why I have my onion.14:20:54
@sudoforge:matrix.orgsudoforge

@rajil:rajils.com both of the links you provided are related to using swap (and hibernation) on a zfs zvol.

what we've described here is setting up swap on a secondary (or tertiary) partition, without formatting it as ZFS.

14:23:47
@sudoforge:matrix.orgsudoforge i have file-based swap under encrypted btrfs on my laptop working and don't recall having to do anything special. did you last try this several years ago, perhaps? 14:25:32
@rajil:rajils.comtrumeeyes, i have a separate non-zfs swap partition. But ZFS does not like hibernate, there could be pool corruption.14:25:40
@albertlarsan68:albertlarsan.frAlbert LarsanI tried about two years ago, on a Fedora system (with an Nvidia graphic card). When I made the switch to NixOS (on my current laptop), I decided it wasn’t worth the trouble (especially with impermanence and other stuff)14:30:08
@albert:sysctl.ioAlbertI had success with this guide https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/ 14:33:18
@sudoforge:matrix.orgsudoforge i'm not sure that's the case; the openzfs disk formatting guide even explicitly instructs users to create a swap partition. 14:33:53

Show newer messages


Back to Room ListRoom Version: 10