From 05ad04bdd339da27b207fec7157e7701e881a36e Mon Sep 17 00:00:00 2001 From: Tulili Date: Sun, 14 Jan 2024 20:17:17 -0300 Subject: [PATCH] pkgs.writers add snu, lua and ruby --- pkgs/build-support/writers/scripts.nix | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pkgs/build-support/writers/scripts.nix b/pkgs/build-support/writers/scripts.nix index 184ecee68777..c268876e1e27 100644 --- a/pkgs/build-support/writers/scripts.nix +++ b/pkgs/build-support/writers/scripts.nix @@ -185,6 +185,46 @@ rec { writeHaskellBin = name: writeHaskell "/bin/${name}"; + # Like writeScript but the first line is a shebang to nu + # + # Example: + # writeNu "example" '' + # echo hello world + # '' + writeNu = makeScriptWriter { + interpreter = "${pkgs.nushell}/bin/nu --no-config-file"; + }; + + # Like writeScriptBin but the first line is a shebang to nu + writeNuBin = name: + writeNu "/bin/${name}"; + + # Like writeScript but the first line is a shebang to ruby + # + # Example: + # writeRuby "example" '' + # puts "hello world" + # '' + writeRuby = makeScriptWriter { + interpreter = "${pkgs.ruby}/bin/ruby"; + }; + + writeRubyBin = name: + writeRuby "/bin/${name}"; + + # Like writeScript but the first line is a shebang to lua + # + # Example: + # writeLua "example" '' + # print("hello world") + # '' + writeLua = makeScriptWriter { + interpreter = "${pkgs.lua}/bin/lua"; + }; + + writeLuaBin = name: + writeLua "/bin/${name}"; + writeRust = name: { rustc ? pkgs.rustc, rustcArgs ? [],