Commit 99da5ec2 authored by Fiona Behrens's avatar Fiona Behrens
Browse files

nixos/systemd-initrd: honor the enable option in contents

The enable attribute of `boot.initrd.systemd.contents.<name>` was
ignored for building initrd storePaths. This resulted in building
derivations for the initrd even if it was disabled.

Found while testing a to build a nixos system with a kernel without
lodable modules[0]

[0]: https://github.com/NixOS/nixpkgs/pull/411792
parent 9f115bcc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -133,7 +133,9 @@ let
    name = "initrd-${kernel-name}";
    inherit (config.boot.initrd) compressor compressorArgs prepend;

    contents = lib.filter ({ source, ... }: !lib.elem source cfg.suppressedStorePaths) cfg.storePaths;
    contents = lib.filter (
      { source, enable, ... }: (!lib.elem source cfg.suppressedStorePaths) && enable
    ) cfg.storePaths;
  };

in