about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorJared Baur <jaredbaur@fastmail.com>2024-01-05 01:04:30 -0800
committerJared Baur <jaredbaur@fastmail.com>2024-01-05 01:04:30 -0800
commit1dad7f68219c6097d9897fef26287796ad66c2f2 (patch)
tree610208fe73bfb4389211fb176f873e813354b074 /nixos/modules/system
parent3e2503b324d5b9cb9d6690e202efda84bf0df65a (diff)
downloadnixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.tar
nixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.tar.gz
nixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.tar.bz2
nixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.tar.lz
nixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.tar.xz
nixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.tar.zst
nixlib-1dad7f68219c6097d9897fef26287796ad66c2f2.zip
nixos/repart: add loop module to initrd
Systemd-repart will use loopback devices for partition creation if it is
able to, and will fallback to doing "offline" partition creation writing
data directly to files. From what I see looking at the repart code,
there are specific features that cannot be taken advantage of when not
using loopback devices (e.g. no BTRFS subvolumes in systemd v255) and in
certain places they have to perform some manual re-sizing work that can
otherwise be avoided.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/systemd/repart.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd/repart.nix b/nixos/modules/system/boot/systemd/repart.nix
index 5ac2ace56ba0..3be744acd0b3 100644
--- a/nixos/modules/system/boot/systemd/repart.nix
+++ b/nixos/modules/system/boot/systemd/repart.nix
@@ -83,6 +83,9 @@ in
       }
     ];
 
+    # systemd-repart uses loopback devices for partition creation
+    boot.initrd.availableKernelModules = lib.optional initrdCfg.enable "loop";
+
     boot.initrd.systemd = lib.mkIf initrdCfg.enable {
       additionalUpstreamUnits = [
         "systemd-repart.service"