impernanence optional

This commit is contained in:
randogoth 2026-02-10 09:34:51 +02:00
parent 99d9f457d3
commit ac83f87c02
3 changed files with 29 additions and 4 deletions

View file

@ -1,10 +1,13 @@
{ config, lib, ... }:
{
config = lib.mkIf (
(config.fileSystems ? "/persist")
&& (config.fileSystems."/persist".fsType or "" == "btrfs")
) {
options.nanuqsaurus.impermanence.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable impermanence with a /persist Btrfs subvolume.";
};
config = lib.mkIf config.nanuqsaurus.impermanence.enable {
boot.initrd.supportedFilesystems = [ "btrfs" ];
boot.initrd.postDeviceCommands = lib.mkAfter ''