feat(sterni/acme): add initial plumbing rules
Rules for the Plan 9 plumber (see https://9p.io/sys/doc/plumb.pdf) allowing quick navigation through depot (and related services) in acme. - man, urls: some rules that I like taken from /plumb/basic and split across individual files. - tvl: incomplete support for TVL short links and targets: - //… - cl/… - b/… As mentioned, these are incomplete and I want to implement the remaining short links and things like git support. I want to continue experimenting with the plumber, but what I've got so far is already pretty cool. Eventually, I'll want to implement something equivalent for Emacs (maybe via Hyperbole) which is probably going to be of general interest to depot users. Change-Id: I678f000369db4c7ce30b2aedbc2dbccf3ddef0a9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/13026 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
edf4bf6165
commit
47cda5e89f
5 changed files with 133 additions and 0 deletions
39
users/sterni/acme/plumb/default.nix
Normal file
39
users/sterni/acme/plumb/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "sterni-plumb";
|
||||
|
||||
src = builtins.path {
|
||||
path = ./.;
|
||||
filter = path: _: !(lib.hasSuffix "default.nix" path);
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
# The write will fail if there's something wrong with the rules,
|
||||
# though it only detects some problems.
|
||||
checkPhase = ''
|
||||
runHook preInstall
|
||||
export NAMESPACE="$(mktemp -d)"
|
||||
9 plumber -f &
|
||||
pid="$!"
|
||||
until [[ -e "$NAMESPACE/plumb" ]]; do
|
||||
sleep 0.1
|
||||
done
|
||||
9 9p write plumb/rules < sterni.plumbing
|
||||
kill "$pid"
|
||||
runHook postInstall
|
||||
'';
|
||||
doCheck = true;
|
||||
checkInputs = [
|
||||
pkgs.plan9port
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p "$out"
|
||||
mv * "$out/"
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue