From cc9e1881063ac6f85e5a0dbc67e0f5801e232728 Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Mon, 23 Dec 2024 12:57:56 +0100 Subject: [PATCH] removed btrfs hook for permanence, if btrfs is not used --- nixos/modules/impermanence/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/impermanence/default.nix b/nixos/modules/impermanence/default.nix index 45793e9..e9e4af8 100644 --- a/nixos/modules/impermanence/default.nix +++ b/nixos/modules/impermanence/default.nix @@ -1,4 +1,7 @@ -{ lib, inputs, ... }: +{ config, lib, inputs, ... }: +let + isBtrfs = config.fileSystems."/".fsType == "btrfs"; +in { imports = [ inputs.impermanence.nixosModules.impermanence @@ -27,7 +30,7 @@ ]; programs.fuse.userAllowOther = true; - boot.initrd.postDeviceCommands = lib.mkAfter '' + boot.initrd.postDeviceCommands = lib.mkAfter (if isBtrfs then '' mkdir /btrfs_tmp mount /dev/root_vg/root /btrfs_tmp if [[ -e /btrfs_tmp/root ]]; then @@ -50,5 +53,5 @@ btrfs subvolume create /btrfs_tmp/root umount /btrfs_tmp - ''; + '' else ''''); }