From 0aed32b9dd2a4118336c31742fed0262bd381d0b Mon Sep 17 00:00:00 2001 From: Viktor Kleen Date: Wed, 6 Mar 2024 10:08:48 +0000 Subject: [PATCH] nixos/systemd: Only include systemd-boot-random-seed if the unit exists The unit file is only present if systemd was built with bootloader support. --- nixos/modules/system/boot/systemd.nix | 2 +- pkgs/os-specific/linux/systemd/default.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 49090423e078..a8885aee78f2 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -97,7 +97,7 @@ let # Maintaining state across reboots. "systemd-random-seed.service" - "systemd-boot-random-seed.service" + ] ++ (optional cfg.package.withBootloader "systemd-boot-random-seed.service") ++ [ "systemd-backlight@.service" "systemd-rfkill.service" "systemd-rfkill.socket" diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 064c465bd6e3..6660bbb521fc 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -851,8 +851,8 @@ stdenv.mkDerivation (finalAttrs: { # needed - and therefore `interfaceVersion` should be incremented. interfaceVersion = 2; - inherit withCryptsetup withHostnamed withImportd withKmod withLocaled - withMachined withPortabled withTimedated withUtmp util-linux kmod kbd; + inherit withBootloader withCryptsetup withHostnamed withImportd withKmod + withLocaled withMachined withPortabled withTimedated withUtmp util-linux kmod kbd; tests = { inherit (nixosTests)