1{
2 lib,
3 writeShellApplication,
4 flakeLocation,
5}:
6writeShellApplication {
7 name = "system";
8 meta = {
9 description = "A shortcut to run `just` in the local system flake directory.";
10 license = lib.licenses.cc0;
11 maintainers = with lib.maintainers; [ soopyc ];
12 };
13
14 # we could make this more robust by not using `just` and (hardcode?) commands in, but this is by far the easiest
15 # and the most versatile method. if it works, it works and i'm not going to overcomplicate this
16 text = ''
17 if [ ! -e ${flakeLocation} ]; then
18 echo "Could not find flake at ${flakeLocation}. Please reconfigure your system."
19 exit 1
20 fi
21
22 cd ${flakeLocation}
23 just "''${@:--l}"
24 '';
25}