Moved 2 functions from different repo to this util library
This commit is contained in:
1 parent
6ba0f3e670
commit
52cad66083
1 file changed
+35
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
description = "A Collection Of Nix Utilities";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }: {
|
||||||
|
writePythonApplication = {name, contentFile}: let
|
||||||
|
wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile);
|
||||||
|
in
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = name;
|
||||||
|
runtimeInputs = [
|
||||||
|
wrappedScript
|
||||||
|
pkgs.python311];
|
||||||
|
text = ''
|
||||||
|
exec ${pkgs.python38}/bin/python ${wrappedScript} "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
writeBabashkaApplication = {name, contentFile}: let
|
||||||
|
wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile);
|
||||||
|
in
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = name;
|
||||||
|
runtimeInputs = [
|
||||||
|
wrappedScript
|
||||||
|
pkgs.babashka];
|
||||||
|
text = ''
|
||||||
|
exec ${pkgs.babashka}/bin/bb ${wrappedScript} "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in new issue
Block a user