From 80982d0457373a4c31c4eb378488d7857fc1ea38 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:24:09 +0100 Subject: [PATCH] prusa-slicer/super-slicer: move NIX_LDFLAGS into env for structuredAttrs --- .../misc/prusa-slicer/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 830601e189cf..6309889d9d91 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -145,14 +145,17 @@ stdenv.mkDerivation (finalAttrs: { doInstallCheck = true; - # The build system uses custom logic - defined in - # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt - # library, which doesn't pick up the package in the nix store. We - # additionally need to set the path via the NLOPT environment variable. - NLOPT = nlopt; - - # prusa-slicer uses dlopen on `libudev.so` at runtime - NIX_LDFLAGS = lib.optionalString withSystemd "-ludev"; + env = { + # The build system uses custom logic - defined in + # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt + # library, which doesn't pick up the package in the nix store. We + # additionally need to set the path via the NLOPT environment variable. + NLOPT = nlopt; + } + // lib.optionalAttrs withSystemd { + # prusa-slicer uses dlopen on `libudev.so` at runtime + NIX_LDFLAGS = "-ludev"; + }; prePatch = '' # Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx