From 45d5a4c8e9f067dae38e2ab784e7eb6de7c1bc3e Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Sat, 13 Jan 2024 11:03:47 +0100 Subject: [PATCH] New nu shell function --- nightmare.nix | 1 + nightmare/writeNuShellScriptBin.nix | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 nightmare/writeNuShellScriptBin.nix diff --git a/nightmare.nix b/nightmare.nix index 36c5929..6508993 100644 --- a/nightmare.nix +++ b/nightmare.nix @@ -1,4 +1,5 @@ { pkgs, ... }: { getKittyColorscheme = pkgs.callPackage ./nightmare/getKittyColorscheme.nix {}; writeNuShellScript = pkgs.callPackage ./nightmare/writeNuShellScript.nix {}; + writeNuShellScriptBin = pkgs.callPackage ./nightmare/writeNuShellScriptBin.nix {}; } diff --git a/nightmare/writeNuShellScriptBin.nix b/nightmare/writeNuShellScriptBin.nix new file mode 100644 index 0000000..3083d66 --- /dev/null +++ b/nightmare/writeNuShellScriptBin.nix @@ -0,0 +1,14 @@ +{ nushell, writeTextFile, ... }: +name: text: +let writeNuShellScriptBin = + writeTextFile { + inherit name; + executable = true; + destination = "/bin/${name}"; + text = '' + #!${nushell}/bin/nu + ${text} + ''; + meta.mainProgram = name; + }; +in writeNuShellScriptBin