diff options
author | Ben Sima <ben@bsima.me> | 2022-08-02 17:34:28 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-08-02 17:34:28 -0400 |
commit | 5ed01579afe46f14ee999b7d2d8be18d6f7d347e (patch) | |
tree | 49d2128869493de26677249fb31dfa3b25465e35 | |
parent | 0a003c3303cf01744436cdf94a36bc73f196e353 (diff) |
Make bild dev build work again
Unfortunately, until bild can instantiate nix builds, it needs all of its
compilers in the dev environment, and I need to pass this environment into the
dev nix-shell in order for it to work in the repl or after being built to _/bin.
-rw-r--r-- | Biz/Bild.nix | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix index abff330..ab120db 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -38,6 +38,16 @@ rec { # generally-useful things from nixpkgs inherit (nixpkgs) lib stdenv sources; + # remove this when I switch to all-nix builds + bildRuntimeDeps = with nixpkgs; [ + pkg-config + guile_3_0 + private.ghcPackageSetBild + rustc + gcc + (private.sbclWith (p: with p; [asdf alexandria])) # just enough to build Example.lisp + ]; + # a standard nix build for `bild` - this should be the only hand-written # builder we need bild = stdenv.mkDerivation { @@ -45,13 +55,7 @@ rec { src = ../.; nativeBuildInputs = [ private.ghcPackageSetBild ]; buildInputs = [ nixpkgs.makeWrapper ]; - propagatedBuildInputs = with nixpkgs; [ - pkg-config - guile_3_0 - rustc - gcc - (private.sbclWith (p: with p; [asdf alexandria])) # just enough to build Example.lisp - ]; + propagatedBuildInputs = bildRuntimeDeps; strictDeps = true; buildPhase = '' mkdir -p $out/bin $out/lib/ghc-${private.ghcPackageSetFull.version} @@ -124,10 +128,12 @@ rec { installPhase = "exit 0"; } // { env = ghc; }; - env = let linters = with nixpkgs.pkgs; [ ormolu hlint deadnix ]; in nixpkgs.pkgs.mkShell { + env = let + linters = with nixpkgs.pkgs; [ ormolu hlint deadnix ]; + in nixpkgs.pkgs.mkShell { name = "bizdev"; # this should just be dev tools - buildInputs = with nixpkgs.pkgs; linters ++ [ + buildInputs = with nixpkgs.pkgs; linters ++ bildRuntimeDeps ++ [ bild ctags figlet @@ -140,6 +146,9 @@ rec { shellcheck wemux ]; + shellHook = '' + export GHC_PACKAGE_PATH=${bild}/lib/ghc-${private.ghcPackageSetFull.version}/package.conf.d + ''; }; # build an operating system. 'cfg' is the NixOS config |