diff options
-rw-r--r-- | pkgs/default.nix | 2 | ||||
-rw-r--r-- | pkgs/echoargs/default.nix | 25 |
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"; + }; +} |