4 cfg = config.boot.initrd.systemd.dmVerity;
8 boot.initrd.systemd.dmVerity = {
9 enable = lib.mkEnableOption "dm-verity" // {
11 Mount verity-protected block devices in the initrd.
13 Enabling this option allows to use `systemd-veritysetup` and
14 `systemd-veritysetup-generator` in the initrd.
20 config = lib.mkIf cfg.enable {
23 assertion = config.boot.initrd.systemd.enable;
25 'boot.initrd.systemd.dmVerity.enable' requires 'boot.initrd.systemd.enable' to be enabled.
31 availableKernelModules = [
36 # dm-verity needs additional udev rules from LVM to work.
37 services.lvm.enable = true;
39 # The additional targets and store paths allow users to integrate verity-protected devices
40 # through the systemd tooling.
42 additionalUpstreamUnits = [
43 "veritysetup-pre.target"
45 "remote-veritysetup.target"
49 "${config.boot.initrd.systemd.package}/lib/systemd/systemd-veritysetup"
50 "${config.boot.initrd.systemd.package}/lib/systemd/system-generators/systemd-veritysetup-generator"
56 meta.maintainers = with lib.maintainers; [