9 requiredStratisFilesystems = lib.attrsets.filterAttrs (
10 _: x: utils.fsNeededForBoot x && x.stratis.poolUuid != null
15 config = lib.mkIf (requiredStratisFilesystems != { }) {
18 assertion = config.boot.initrd.systemd.enable;
19 message = "stratis root fs requires systemd stage 1";
25 "${pkgs.stratisd}/lib/udev/stratis-base32-decode"
26 "${pkgs.stratisd}/lib/udev/stratis-str-cmp"
27 "${pkgs.lvm2.bin}/bin/dmsetup"
28 "${pkgs.stratisd}/libexec/stratisd-min"
29 "${pkgs.stratisd.initrd}/bin/stratis-rootfs-setup"
31 packages = [ pkgs.stratisd.initrd ];
33 thin_check = "${pkgs."thin-provisioning-tools"}/bin/thin_check";
34 thin_repair = "${pkgs."thin-provisioning-tools"}/bin/thin_repair";
35 thin_metadata_size = "${pkgs."thin-provisioning-tools"}/bin/thin_metadata_size";
36 stratis-min = "${pkgs.stratisd}/bin/stratis-min";
38 services = lib.attrsets.mapAttrs' (mountPoint: fileSystem: {
39 name = "stratis-setup-${fileSystem.stratis.poolUuid}";
41 description = "setup for Stratis root filesystem";
42 unitConfig.DefaultDependencies = "no";
45 "initrd-switch-root.target"
47 onFailure = [ "emergency.target" ];
48 unitConfig.OnFailureJobMode = "isolate";
50 "stratisd-min.service"
51 "plymouth-start.service"
53 wantedBy = [ "initrd.target" ];
56 "plymouth-start.service"
57 "stratisd-min.service"
62 "initrd-switch-root.target"
64 environment.STRATIS_ROOTFS_UUID = fileSystem.stratis.poolUuid;
67 ExecStart = "${pkgs.stratisd.initrd}/bin/stratis-rootfs-setup";
68 RemainAfterExit = "yes";
71 }) requiredStratisFilesystems;
73 availableKernelModules =
93 services.udev.packages = [