diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 0000000..542db67 --- /dev/null +++ b/HACKING.md @@ -0,0 +1,31 @@ + +# Hacking on the modules + +## Easiest option + +The module system does not distinguish between modules and configurations. +This mean you can prototype any feature by factoring out functionality in a real-world project. + +## Changing the built-in modules + +If your change is not just an addition or if it's better implemented by refactoring, you'll want to fork and edit arion sources directly. + +For a fast iteration cycle (but possibly outdated arion command logic): + + ~/src/arion/run-arion-quick up -d + +To update the arion command logic on the next run + + rm ~/src/arion/result-run-arion-quick + + +# Hacking on the arion command + +The arion command is written in Haskell. Anyone can make small changes to the code. +Experience with Haskell tooling is not required. You can use the nixified scripts in the root of the repo for common tasks. + - `build` or `live-check` for typechecking + - `live-unit-tests` (only the test suite is "live" though) + - `repl` for a Haskell REPL + - `run-arion` to run an incrementally built arion + - `run-arion-via-nix` to run a nix-built arion + - ~~`run-arion-quick`~~ *not for command hacking;* use stale command. See previous section. diff --git a/run-arion-quick b/run-arion-quick new file mode 100755 index 0000000..df1c3e8 --- /dev/null +++ b/run-arion-quick @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +projectRoot="$(dirname ${BASH_SOURCE[0]})" +resultLink="$projectRoot/result-run-arion-quick" + +[[ -e "$resultLink" ]] || { + echo 1>&2 "You don't have a prebuilt arion yet; building it." + nix-build "$projectRoot" -A arion --out-link "$resultLink" +} + +echo 1>&2 "Note that you will need to rm '$resultLink' to rebuild the arion executable when needed." + +export arion_compose_datadir="$projectRoot/src" + +exec "$resultLink/bin/arion" "$@"