fix shadowing issue and add purescript deriv as optional argument

This commit is contained in:
Rachel Lambda Samuelsson 2023-07-23 17:48:08 +02:00
parent 8a53607ed9
commit 90f0f23ad5
2 changed files with 10 additions and 4 deletions

View File

@ -2,6 +2,8 @@
# #
# nodejs?: node derivation to use for running executables # nodejs?: node derivation to use for running executables
# #
# purescript?: purescript derivation to use for compilation
#
# deps: # deps:
# { # {
# name # name
@ -28,12 +30,13 @@
{ pkgs { pkgs
, purescript ? pkgs.purescript
, nodejs ? pkgs.nodejs , nodejs ? pkgs.nodejs
, deps , deps
, out }: , out }:
with pkgs; with builtins; with builtins;
let inputs = let inputs =
map (d: stdenv.mkDerivation { map (d: pkgs.stdenv.mkDerivation {
name = d.name; name = d.name;
version = d.version; version = d.version;
src = d.src or fetchGit { src = d.src or fetchGit {
@ -43,7 +46,7 @@ let inputs =
installPhase = ''cp -r "$src" "$out"''; installPhase = ''cp -r "$src" "$out"'';
}) })
deps; deps;
in stdenv.mkDerivation { in pkgs.stdenv.mkDerivation {
pname = out.name; pname = out.name;
version = out.version; version = out.version;
src = out.src; src = out.src;

View File

@ -12,7 +12,10 @@ Import `psDeriver.nix` and pass the following arguments:
The usual nixpkgs The usual nixpkgs
### `nodejs` (optional) ### `nodejs` (optional)
Nodejs derivation to use for running executables. If not specified then `pkgs.nodejs` will be used. Nodejs derivation to use for running executables. If not specified then `pkgs.nodejs` will be used. Will not be used if no executable is specified.
### `purescript` (optional)
Purescript derivation to use for compilation. If not specified then `pkgs.purescript` will be used.
### `deps` ### `deps`
A list of dependencies in one of the following formats: A list of dependencies in one of the following formats: