From 48b7b222491b2799e265cda9a0b8be0d5d8eb3c0 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 31 Jul 2023 10:15:34 -0400 Subject: Prototype nix expression generation There are some limitations to this implementation: 1. Using `runCommand` means this will re-run any time anything changes in the repo. The solution is to use the existing import detection to make a list of source files, and put that into a `stdenv.mkDerivation`, which I'll do next. 2. The `NeatInterpolation` usage is ugly. The templated nix code should be extracted into its own file, such as `Biz/Bild/Builder.nix`. 3. I'm not actually calling it yet. The ideal thing would be to call `nix-instantiate`, get the output drv path, and then call `nix-store --realise` on that. To do that I need to refactor my `proc` function to return stdout to the calling function, and I should probably just make helper functions like `nixInstatiate :: Target -> IO DrvPath` and `nixStoreRealise :: DrvPath -> NixStorePath`, or something like that. --- Biz/Bild.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Biz/Bild.nix') diff --git a/Biz/Bild.nix b/Biz/Bild.nix index a51a3d0..2a049b0 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -36,7 +36,7 @@ rec { }; # generally-useful things from nixpkgs - inherit (nixpkgs) lib stdenv sources; + inherit (nixpkgs) lib stdenv sources runCommand; # expose some packages for inclusion in os/image builds pkgs = with nixpkgs.pkgs; [ git ]; @@ -45,14 +45,12 @@ rec { bildRuntimeDeps = with nixpkgs; [ pkg-config gnutls - guile - SDL private.ghcPackageSetBild rustc - gcc - gdb - valgrind - argp-standalone + # c deps + gcc gdb valgrind argp-standalone SDL + # lisp deps + guile (private.sbclWith (p: with p; [asdf alexandria])) # just enough to build Example.lisp ]; -- cgit v1.2.3