summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-11-17 07:21:30 +0100
committerLinnnus <[email protected]>2024-11-17 07:21:30 +0100
commit9d7af0876ca7fbe137150f280db8bafbfa65afa7 (patch)
tree064eeddebfba3b26b013648e9005a708df423264
parenteb3c2a300a4df97f2b0231f9706f0f402c6c8597 (diff)
pkgs: Add echoargs
-rw-r--r--pkgs/default.nix2
-rw-r--r--pkgs/echoargs/default.nix25
2 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index d7a9f19..d0dafaa 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -29,6 +29,8 @@ pkgs: {
nowrap = pkgs.callPackage ./nowrap {};
+ echoargs = pkgs.callPackage ./echoargs {};
+
# TODO: These should be contained in the 'vimPlugins' attrset. This turns out
# to be non-trivial because this module is both consumed in a flake output
# context and an overlay context.
diff --git a/pkgs/echoargs/default.nix b/pkgs/echoargs/default.nix
new file mode 100644
index 0000000..a74b716
--- /dev/null
+++ b/pkgs/echoargs/default.nix
@@ -0,0 +1,25 @@
+{
+ writeTextFile,
+ python3,
+ lib,
+}:
+writeTextFile {
+ name = "echoargs";
+
+ text = ''
+ #!${python3.interpreter}
+
+ import sys
+ import json
+
+ for i, arg in enumerate(sys.argv):
+ print(f"argv[%d] = %s" % (i, json.dumps(arg)))
+ '';
+ executable = true;
+ destination = "/bin/echoargs";
+
+ meta = with lib; {
+ description = "Prints command-line arguments for debugging";
+ mainProgram = "echoargs";
+ };
+}