about summary refs log tree commit diff
path: root/users/Profpatsch/netencode/default.nix (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-02-13 r/2211 chore(users/Profpatsch/netencode): move nom dependencies to pkgsetProfpatsch1-23/+1
Change-Id: I7393f60e4b29f24399d681d4546ac35140650d1a Reviewed-on: https://cl.tvl.fyi/c/depot/+/2524 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 r/2210 feat(users/Profpatsch/netencode/record-splice-env): ignore non-scalProfpatsch1-3/+8
The headers are not a scalar, so record-splice-env doesn’t know how to convert them to an envvar; let’s just ignore everything that can’t be converted to a scalar for now. Change-Id: I74ed0aa942fcd26beb058705830bc2f2b516e93e Reviewed-on: https://cl.tvl.fyi/c/depot/+/2523 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 r/2207 feat(users/Profpatsch/execline/exec_helpers): add args()Profpatsch1-1/+1
Some programs need an exact amount of arguments, and we want to fail if they get too many or not enough. Change-Id: Ic703949f38780718f26118b896e7c7d7aa5553d9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2504 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 r/2205 feat(users/Profpatsch/netencode): add record-getProfpatsch1-0/+30
Projecting into one record field of netencode given on stdin. Change-Id: I975bd5558a06988aa159156ca73a449710db983f Reviewed-on: https://cl.tvl.fyi/c/depot/+/2502 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-09 r/2190 feat(users/Profpatsch/netencode): add `dec::RecordDot`Profpatsch1-1/+1
`dec::RecordDot` accesses a specific field of a netencode record. In order to implement this, either we’d have to introduce a type-level string, but in all honesty this kind of typelevel circlejerking never leads anywhere, so let’s change the trait to use `&self` after all. Usage is pretty much the same, except actually more like you’d expect. Change-Id: I5a7f1a3f587256c50df1b65c2969e5a7194bba70 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2494 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 r/2188 feat(users/Profpatsch/netencode): decode from UProfpatsch1-2/+3
Since we don’t necessarily need to decode deeply, we can make the decoders take a `U` instead of a `T`. Change-Id: I9704a21edb3922d58411e6807d027d684b18d390 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2492 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 r/2180 fix(users/Profpatsch/netencode_mustache): add arglib crate to depssterni1-0/+1
Seems like 5d44df3af65767e731c0dd239bd1d9664edbb361 forgot to add the newly split out crate to the dependencies of netencode_mustache. CI didn't pick up on it since it is hidden away from readTree in an attrset in a file. Change-Id: I7df9a636d849de48a99562d1cda8c0e6765f4781 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2485 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2176 feat(users/Profpatsch): add die_* helpers for semantic exit errorsProfpatsch1-3/+6
There is this semantic exit code schema championed by execline and skaware tooling, and we refined and documented it a bit in lorri https://github.com/nix-community/lorri/blob/d1d673d42090f0cfe8ab9b92b465315a9e7d30a3/src/ops/mod.rs#L24-L35 in the past. This just transcribes the error messages into simple helper functions. Applies the functions to the places where we would panic or die `sys::exit()` instead. Change-Id: I15ca05cd6f99a25a3378518be94110eab416354e Reviewed-on: https://cl.tvl.fyi/c/depot/+/2475 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2175 feat(users/Profpatsch/execline): add args_for_execProfpatsch1-9/+8
`exec_into_args` would just read argv and exec into it, but we want to be able to write commands which take some positional arguments first. Thus we split the invocation into `args_for_exec`, which returns the positional arguments and prog, and then pass prog to `exec_into_args` when we want to exec eventually (prog is still an iterator at this point). Change-Id: I0b180c1a100b96363fe33ba2c42034ed41716b7a Reviewed-on: https://cl.tvl.fyi/c/depot/+/2474 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2173 feat(users/Profpatsch/netencode): add record-splice-envProfpatsch1-0/+25
Splice a netencode record from stdin into the environment. Change-Id: I7eac19e18164e070e4463ee431d9b0e955857b9c Reviewed-on: https://cl.tvl.fyi/c/depot/+/2454 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-27 r/2149 chore(users/Profpatsch/netencode): netencode.nix -> gen.nixProfpatsch1-2/+2
Change-Id: I7ccbfe863fbff65015caa8c740b80c4bb5c59dc1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2446 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
2021-01-03 r/2058 feat(Profpatsch/netencode): add netencode-mustacheProfpatsch1-0/+51
A little executable, combining the netencode and mustache libraries to make easy templating from the command line possible. Combined with the nix netencode generators, it’s now trivial to populate a mustache template with (nearly) arbitrary data. Yay. Change-Id: I5b892c38fbc33dd826a26174dd9567f0b72e6322 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2320 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
2021-01-03 r/2057 feat(Profpatsch): dump netencode spec & parserProfpatsch1-0/+48
The netencode standard, a no-nonsense extension of netstrings for structured data. Includes a nix generator module and a rust parsing library. Imported from https://github.com/openlab-aux/vuizvui/tree/e409df3861f48de44d0e37277ce007e348a7a0dc/pkgs/profpatsch/netencode Original license GPLv3, but I’m the sole author, so I transfer it to whatever license depot uses. Change-Id: I4f6fa97120a0fd861eeef35085a3dd642ab7c407 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2319 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>