From 5516d6548cf81355b3f36a590e856642c9ba6cac Mon Sep 17 00:00:00 2001 From: didier amyot Date: Sun, 30 Apr 2023 09:10:20 -0400 Subject: [PATCH] Added the possibility to add extra runtime inputs to scripts --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index ded7c98..92c5a0a 100644 --- a/flake.nix +++ b/flake.nix @@ -12,27 +12,27 @@ pkgs = import nixpkgs { inherit system;}; in { - writePythonApplication = {name, contentFile}: let + writePythonApplication = {name, contentFile, extraRuntimeInputs ? []}: let wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile); in pkgs.writeShellApplication { name = name; runtimeInputs = [ wrappedScript - pkgs.python311]; + pkgs.python311] ++ extraRuntimeInputs; text = '' exec ${pkgs.python38}/bin/python ${wrappedScript} "$@" ''; }; - writeBabashkaApplication = {name, contentFile}: let + writeBabashkaApplication = {name, contentFile, extraRuntimeInputs ? []}: let wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile); in pkgs.writeShellApplication { name = name; runtimeInputs = [ wrappedScript - pkgs.babashka]; + pkgs.babashka] ++ extraRuntimeInputs; text = '' exec ${pkgs.babashka}/bin/bb ${wrappedScript} "$@" '';