solution: use gradle 7.2
Co-authored-by: Brian McGee <brian@41north.dev>
This commit is contained in:
29
nix/mkEnv.nix
Normal file
29
nix/mkEnv.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ lib, writeText, buildEnv }:
|
||||
|
||||
{ name ? "dev-env"
|
||||
, # Environment variables to set
|
||||
env ? { }
|
||||
, # Packages to add to the path
|
||||
paths ? [ ]
|
||||
}:
|
||||
let
|
||||
envToBash = name: value:
|
||||
"export ${name}=${lib.escapeShellArg (toString value)}"
|
||||
;
|
||||
|
||||
exports = lib.concatStringsSep "\n"
|
||||
(map (name: envToBash name env.${name}) (lib.attrNames env));
|
||||
|
||||
env-root = writeText "env-root" ''
|
||||
export PATH=@env-root@/bin:$PATH
|
||||
|
||||
${exports}
|
||||
'';
|
||||
in
|
||||
buildEnv {
|
||||
inherit name;
|
||||
paths = paths;
|
||||
postBuild = ''
|
||||
sed "s|@env-root@|$out|g" ${env-root} > $out/.profile
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user