removed btrfs hook for permanence, if btrfs is not used

This commit is contained in:
Aleksandr Lebedev 2024-12-23 12:57:56 +01:00
parent 2e2d2a464f
commit cc9e188106

View file

@ -1,4 +1,7 @@
{ lib, inputs, ... }: { config, lib, inputs, ... }:
let
isBtrfs = config.fileSystems."/".fsType == "btrfs";
in
{ {
imports = [ imports = [
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
@ -27,7 +30,7 @@
]; ];
programs.fuse.userAllowOther = true; programs.fuse.userAllowOther = true;
boot.initrd.postDeviceCommands = lib.mkAfter '' boot.initrd.postDeviceCommands = lib.mkAfter (if isBtrfs then ''
mkdir /btrfs_tmp mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp mount /dev/root_vg/root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then if [[ -e /btrfs_tmp/root ]]; then
@ -50,5 +53,5 @@
btrfs subvolume create /btrfs_tmp/root btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp umount /btrfs_tmp
''; '' else '''');
} }