summaryrefslogtreecommitdiff
path: root/Biz/Bild.nix
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Bild.nix')
-rw-r--r--Biz/Bild.nix37
1 files changed, 17 insertions, 20 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix
index 1955d2c..183e633 100644
--- a/Biz/Bild.nix
+++ b/Biz/Bild.nix
@@ -53,15 +53,15 @@ in nixpkgs // { bild = rec {
bildRuntimeDeps = with nixpkgs; [
pkg-config
# this is just to get access to ghc-pkg in bild
- (haskell.ghcWith (hpkgs: with hpkgs; []))
+ (haskell.ghcWith (_: []))
# lisp deps
guile
(lisp.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
+ # a standard nix build for bild, for bootstrapping. this should be the only
+ # hand-written builder we need
bild = nixpkgs.stdenv.mkDerivation {
name = "bild";
src = ../.;
@@ -91,7 +91,7 @@ in nixpkgs // { bild = rec {
};
# wrapper around bild
- runBildAnalyze = main: nixpkgs.stdenv.mkDerivation rec {
+ runBildAnalyze = target: nixpkgs.stdenv.mkDerivation rec {
name = "bild-analysis";
src = ../.;
USER = "nixbld";
@@ -100,10 +100,10 @@ in nixpkgs // { bild = rec {
BIZ_ROOT = "/build/biz";
# we need to remove the $src root because bild expects paths relative to the
# working directory:
- MAIN = "." + lib.strings.removePrefix (toString src) (toString main);
+ TARGET = "." + lib.strings.removePrefix (toString src) (toString target);
buildPhase = ''
mkdir $out
- ${bild}/bin/bild --json "$MAIN" 1> $out/analysis.json \
+ ${bild}/bin/bild --json "$TARGET" 1> $out/analysis.json \
2> >(tee -a $out/stderr >&2)
'';
installPhase = "exit 0";
@@ -111,31 +111,28 @@ in nixpkgs // { bild = rec {
# gather data needed for compiling by analyzing the main module. returns the
# json object of the build
- analyze = main: builtins.readFile (runBildAnalyze main + "/analysis.json");
+ analyze = target: builtins.readFile (runBildAnalyze target + "/analysis.json");
- # i think this isn't going to work because we have a nix-in-nix problem.
- # instead:
- # - get the store path some other way. if i can pass that to bild.os, then nix
- # should automatically get all the deps required
- # - just do runBildAnalyze, pass the args to Bild/Builder.nix, should continue
- # no problem
- run = main: import ./Bild/Builder.nix { analysisJSON = analyze main; };
+ # this does a bild build for the given target, but entirely in nix. its kinda
+ # like IFD, but not as costly, i think
+ run = target: import ./Bild/Builder.nix { analysisJSON = analyze target; };
# the main development environment
- env = let
- linters = with nixpkgs.pkgs; [ ormolu hlint deadnix indent black];
- in nixpkgs.pkgs.mkShell {
+ env = nixpkgs.pkgs.mkShell {
name = "bizdev";
# this should just be dev tools
- buildInputs = with nixpkgs.pkgs; linters ++ bildRuntimeDeps ++ [
+ buildInputs = with nixpkgs.pkgs; [
bild
+ black
ctags
+ deadnix
figlet
git
- nixpkgs.haskell.packages.${constants.ghcCompiler}.fast-tags
+ gitlint
hlint
+ indent
lolcat
- #nixops # fails to build
+ nixpkgs.haskell.packages.${constants.ghcCompiler}.fast-tags
ormolu
shellcheck
wemux