From e583172fcb0ba144bad69ff47db18a5282c7cd86 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 15 Jan 2023 16:44:38 +0100 Subject: [PATCH] toybox: small refactor --- pkgs/tools/misc/toybox/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/toybox/default.nix b/pkgs/tools/misc/toybox/default.nix index 800cdbad0972..508f0f4cee51 100644 --- a/pkgs/tools/misc/toybox/default.nix +++ b/pkgs/tools/misc/toybox/default.nix @@ -6,6 +6,10 @@ extraConfig ? "" }: +let + inherit (lib) optionals; +in + stdenv.mkDerivation rec { pname = "toybox"; version = "0.8.8"; @@ -17,12 +21,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-T3qE9xlcEoZOcY52XfYPpN34zzQl6mfcRnyuldnIvCk="; }; - depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; # needed for cross + depsBuildBuild = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; buildInputs = [ libxcrypt - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ optionals stdenv.isDarwin [ libiconv - ] ++lib.optionals (enableStatic && stdenv.cc.libc ? static) [ + ] ++ optionals (enableStatic && stdenv.cc.libc ? static) [ stdenv.cc.libc stdenv.cc.libc.static ]; @@ -51,7 +55,7 @@ stdenv.mkDerivation rec { make oldconfig ''; - makeFlags = [ "PREFIX=$(out)/bin" ] ++ lib.optional enableStatic "LDFLAGS=--static"; + makeFlags = [ "PREFIX=$(out)/bin" ] ++ optionals enableStatic [ "LDFLAGS=--static" ]; installTargets = [ "install_flat" ];