From 5afa84342ca69c953fb99d20253f8f0d67c2ebe2 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Sat, 9 Mar 2024 00:44:49 -0700 Subject: [PATCH] package: migrate devShells Change-Id: Ic63721667edd4bef79aa699a0de8411639e5159b --- flake.nix | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/flake.nix b/flake.nix index 4c80e15a1..bb62ae440 100644 --- a/flake.nix +++ b/flake.nix @@ -559,36 +559,26 @@ devShells = let makeShell = pkgs: stdenv: let - canRunInstalled = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + nix = pkgs.callPackage ./package.nix { + inherit stdenv versionSuffix fileset; + boehmgc = pkgs.boehmgc-nix; + busybox-sandbox-shell = pkgs.busybox-sandbox-shell or pkgs.default-busybox-sandbox; + }; in - with commonDeps { inherit pkgs; }; - stdenv.mkDerivation { - name = "nix"; + nix.overrideAttrs (prev: { + nativeBuildInputs = prev.nativeBuildInputs + ++ lib.optional (stdenv.cc.isClang && !stdenv.buildPlatform.isDarwin) pkgs.buildPackages.bear + ++ lib.optional + (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) + pkgs.buildPackages.clang-tools; + src = null; - outputs = [ "out" "dev" "doc" ]; + doInstallCheck = false; + doCheck = false; + installFlags = "sysconfdir=$(out)/etc"; + strictDeps = false; - nativeBuildInputs = nativeBuildDeps - ++ lib.optional (stdenv.cc.isClang && !stdenv.buildPlatform.isDarwin) pkgs.buildPackages.bear - ++ lib.optional - (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) - pkgs.buildPackages.clang-tools - # We want changelog-d in the shell even if the current build doesn't need it - ++ lib.optional (officialRelease || ! buildUnreleasedNotes) changelog-d - ; - - buildInputs = buildDeps ++ propagatedDeps - ++ awsDeps ++ checkDeps ++ internalApiDocsDeps; - - configureFlags = configureFlags - ++ testConfigureFlags ++ internalApiDocsConfigureFlags - ++ lib.optional (!canRunInstalled) "--disable-doc-gen"; - - enableParallelBuilding = true; - - installFlags = "sysconfdir=$(out)/etc"; - - shellHook = - '' + shellHook = '' PATH=$prefix/bin:$PATH unset PYTHONPATH export MANPATH=$out/share/man:$MANPATH @@ -596,7 +586,7 @@ # Make bash completion work. XDG_DATA_DIRS+=:$out/share ''; - }; + }); in forAllSystems (system: let