make default.nix a function callable by callPackage
This commit is contained in:
parent
63232841cd
commit
a36876194d
13
default.nix
13
default.nix
@ -1,4 +1,9 @@
|
|||||||
with import <nixpkgs> {};
|
{
|
||||||
|
lua5_3
|
||||||
|
, stdenv
|
||||||
|
, fennel
|
||||||
|
, makeWrapper
|
||||||
|
}:
|
||||||
let lua = lua5_3.withPackages (ps: [
|
let lua = lua5_3.withPackages (ps: [
|
||||||
ps.dkjson
|
ps.dkjson
|
||||||
ps.lpeg
|
ps.lpeg
|
||||||
@ -6,7 +11,7 @@ let lua = lua5_3.withPackages (ps: [
|
|||||||
ps.luaposix
|
ps.luaposix
|
||||||
]);
|
]);
|
||||||
inherit makeWrapper;
|
inherit makeWrapper;
|
||||||
fennel = pkgs.fennel.override { inherit lua; };
|
myfennel = fennel.override { inherit lua; };
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
pname = "grafana-sms-alert";
|
pname = "grafana-sms-alert";
|
||||||
version = "0.1";
|
version = "0.1";
|
||||||
@ -16,9 +21,9 @@ in stdenv.mkDerivation {
|
|||||||
lua_path="`lua -e 'print(package.path)'`"
|
lua_path="`lua -e 'print(package.path)'`"
|
||||||
lua_cpath="`lua -e 'print(package.cpath)'`"
|
lua_cpath="`lua -e 'print(package.cpath)'`"
|
||||||
|
|
||||||
makeWrapper ${fennel}/bin/fennel $out/bin/grafana-sms-alert \
|
makeWrapper ${myfennel}/bin/fennel $out/bin/grafana-sms-alert \
|
||||||
--add-flags "$out/lib/main.fnl"
|
--add-flags "$out/lib/main.fnl"
|
||||||
'';
|
'';
|
||||||
buildInputs = [lua fennel];
|
buildInputs = [lua myfennel];
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user