From 25df9174a43e97f266bd8b24d5266ec417dcac61 Mon Sep 17 00:00:00 2001 From: Nico Felbinger Date: Mon, 8 Jun 2026 21:08:19 +0200 Subject: [PATCH] nixos/malloc: check legacy scudo options exist before use --- nixos/modules/config/malloc.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nixos/modules/config/malloc.nix b/nixos/modules/config/malloc.nix index bc6a27673e3e..ebc173a642e8 100644 --- a/nixos/modules/config/malloc.nix +++ b/nixos/modules/config/malloc.nix @@ -142,10 +142,14 @@ in # so we can warn the user about the change. legacyOptionsUsed = lib.lists.filter (opt: lib.strings.hasInfix opt scudoOpts) legacyOptionNames; in - lib.optional (cfg.provider == "scudo" && legacyOptionsUsed != [ ]) '' - environment.variables.SCUDO_OPTIONS: ${lib.concatStringsSep ", " legacyOptionsUsed} is/are no longer valid Scudo options. - Use snake_case instead of CamelCase: https://llvm.org/docs/ScudoHardenedAllocator.html#options - ''; + lib.optional + ( + config.environment.variables ? SCUDO_OPTIONS && cfg.provider == "scudo" && legacyOptionsUsed != [ ] + ) + '' + environment.variables.SCUDO_OPTIONS: ${lib.concatStringsSep ", " legacyOptionsUsed} is/are no longer valid Scudo options. + Use snake_case instead of CamelCase: https://llvm.org/docs/ScudoHardenedAllocator.html#options + ''; environment.etc."ld-nix.so.preload".text = '' ${providerLibPath}