From ded10fbd83ed2c6c4ebdf2b024a1388d8b7fd63d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 9 Dec 2019 12:27:07 +0000 Subject: feat(tools): Add auto-dispatch for Advent of Code solutions --- tools/aoc2019/default.nix | 2 +- tools/bin/__dispatch.sh | 3 +++ tools/bin/aoc2019 | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 120000 tools/bin/aoc2019 diff --git a/tools/aoc2019/default.nix b/tools/aoc2019/default.nix index 3c10ea88b1..a53586eea9 100644 --- a/tools/aoc2019/default.nix +++ b/tools/aoc2019/default.nix @@ -14,7 +14,7 @@ let solutions = map (f: let day = getDay f; in { name = day; value = pkgs.writeElispBin { - name = "solution-${day}"; + name = "aoc2019"; deps = p: with p; [ dash s ht ]; src = ./. + ("/" + f); }; diff --git a/tools/bin/__dispatch.sh b/tools/bin/__dispatch.sh index c22b0339fd..fb8a4d7791 100755 --- a/tools/bin/__dispatch.sh +++ b/tools/bin/__dispatch.sh @@ -25,6 +25,9 @@ case "${TARGET_TOOL}" in pass) attr="tools.kms_pass" ;; + aoc2019) + attr="tools.aoc2019.${1}" + ;; *) echo "The tool '${TARGET_TOOL}' is currently not installed in this repository." exit 1 diff --git a/tools/bin/aoc2019 b/tools/bin/aoc2019 new file mode 120000 index 0000000000..8390ec9c96 --- /dev/null +++ b/tools/bin/aoc2019 @@ -0,0 +1 @@ +__dispatch.sh \ No newline at end of file -- cgit 1.4.1