From 4b27d4f9f8f5396d0d6688d567568241e8bc34f9 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 23 Jan 2022 11:58:30 +0100 Subject: nixos/systemd: only use cryptsetup units if systemd was built with it --- pkgs/os-specific/linux/systemd/default.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'pkgs/os-specific/linux/systemd') diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 3c11c03dfdc..23e75e86124 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -596,16 +596,20 @@ stdenv.mkDerivation { rm -rf $out/share/doc ''; - # The interface version prevents NixOS from switching to an - # incompatible systemd at runtime. (Switching across reboots is - # fine, of course.) It should be increased whenever systemd changes - # in a backwards-incompatible way. If the interface version of two - # systemd builds is the same, then we can switch between them at - # runtime; otherwise we can't and we need to reboot. - passthru.interfaceVersion = 2; - - passthru.tests = { - inherit (nixosTests) switchTest; + passthru = { + # The interface version prevents NixOS from switching to an + # incompatible systemd at runtime. (Switching across reboots is + # fine, of course.) It should be increased whenever systemd changes + # in a backwards-incompatible way. If the interface version of two + # systemd builds is the same, then we can switch between them at + # runtime; otherwise we can't and we need to reboot. + interfaceVersion = 2; + + inherit withCryptsetup; + + tests = { + inherit (nixosTests) switchTest; + }; }; meta = with lib; { -- cgit 1.4.1