From 84727bebb42ded17c128567e34636c4cdc7eed45 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 18 Dec 2023 12:59:58 -0800 Subject: [PATCH] Backport PR#9633 by cole-h: package: don't set sysconfdir in devShells (cherry-picked from commit ba0087316acc2aba999cabe5e1a159da636b2569) Change-Id: I5a50afb3b7b65516df798ee51b74f06727a91928 --- flake.nix | 1 + package.nix | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c48cc7478..62037e1e3 100644 --- a/flake.nix +++ b/flake.nix @@ -313,6 +313,7 @@ inherit stdenv versionSuffix fileset; boehmgc = pkgs.boehmgc-nix; busybox-sandbox-shell = pkgs.busybox-sandbox-shell or pkgs.default-busybox-sandbox; + forDevShell = true; }; in nix.overrideAttrs (prev: { diff --git a/package.nix b/package.nix index 482861379..8d33759b7 100644 --- a/package.nix +++ b/package.nix @@ -44,6 +44,8 @@ # Set to true to build the release notes for the next release. buildUnreleasedNotes ? false, internalApiDocs ? false, + # Avoid setting things that would interfere with a functioning devShell + forDevShell ? false, # Not a real argument, just the only way to approximate let-binding some # stuff for argument defaults. @@ -205,12 +207,12 @@ in stdenv.mkDerivation (finalAttrs: { "--with-sandbox-shell=${busybox-sandbox-shell}/bin/busybox" ] ++ lib.optionals (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) [ "LDFLAGS=-fuse-ld=gold" - ] ++ [ "--sysconfdir=/etc" ] + ] ++ lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell" ++ lib.optionals (finalAttrs.doCheck || internalApiDocs) testConfigureFlags ++ lib.optional (!canRunInstalled) "--disable-doc-gen" ++ [ (lib.enableFeature internalApiDocs "internal-api-docs") ] - ; + ++ lib.optional (!forDevShell) "--sysconfdir=/etc"; installTargets = lib.optional internalApiDocs "internal-api-html";