about summary refs log tree commit diff
path: root/users/Profpatsch/netencode/default.nix (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-24 r/2547 chore(nix): move rustSimple from users.Profpatsch.writersProfpatsch1-12/+7
I think it’s solid enough to use in a wider context. Change-Id: If53e8bbb6b90fa88d73fb42730db470e822ea182 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3055 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-04-23 r/2545 feat(users/Profpatsch/lib): add eprint-stdin-netencodeProfpatsch1-3/+3
Like `eprint-stdin`, but reads stdin as netencode and pretty-prints it to stderr. Change-Id: I430c010b0cac45f077cde9dadfd79adfa7a53eca Reviewed-on: https://cl.tvl.fyi/c/depot/+/2533 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 r/2544 feat(users/Profpatsch/netencode): add pretty printerProfpatsch1-0/+32
Simple pretty printer for netencode values, as a rust library and an accompanying command line tool which takes netencode on stdin and prints the pretty version to stdout. Change-Id: I0a57c644985162bc08a9bf1ee78f7be278400199 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2532 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 r/2543 feat(users/Profpatsch/netencode): add env-splice-recordProfpatsch1-6/+33
It’s the inverse of record-splice-env! It sucks up the environment and prints it as a netencode dict! Only the utf-8 clean parts at least. Change-Id: I96c19fc5ea3a67a23e238f15f4d0fa783081859c Reviewed-on: https://cl.tvl.fyi/c/depot/+/2527 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-04 r/2434 feat(users/Profpatsch/writers): make testing default for rustSimpleProfpatsch1-3/+2
This way we don’t have to explicitely wrap the rust crate with a `testRustSimple`, but it will be done automatically, unless `doCheck` is set to `false`. Change-Id: I32a81821eeff620e7da57332b0873495bb85a843 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2841 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: sterni <sternenseemann@systemli.org>
2021-04-03 r/2419 chore: move all 3p buildRustCrate derivations to //third_partysterni1-40/+2
Profpatsch and me are basically the only users of depot.users.Profpatsch.writers.rustSimple*. To pull in the odd dependency we usually use buildRustCrate which is rather convenient. However we've picked up the bad habit of inlining these in a let somewhere instead of managing them in a more central location although there has been an (unsuccesful) attempt at this in //users/Profpatsch/rust-crates.nix. This CL moves all buildRustCrate based derivations into third_party.rust-crates and deletes any duplicate derivations we have accumulated in the tree. Change-Id: I8f68b95ebd546708e9af07dca36d72dba9ca8c77 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2769 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-03-15 r/2282 feat(users/Profpatsch): build attrset members on CIsterni1-1/+1
Setting meta.targets to include all derivations in the different package sets in Profpatsch's user folder makes them checked by CI until they do the readTree refactor as promised. To reduce code duplication we handle this in a simple function which is exposed from nix.utils which may be a good place for depot specific bits and bops we accumulate over time. To get around the issue of too nested sets we perform the following renames: * users.Profpatsch.tests gets moved into its own directory * users.Profpatsch.arglib.netencode now lives in its own file instead of the default.nix * users.Profpatsch.netstring.tests gets moved into its own directory Change-Id: Icd039c29d7760a711c1c53554504d6b0cd19e120 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2603 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-18 r/2219 chore(users/Profpatsch/netencode): update serdesterni1-4/+4
Was messing around with serde and trying to build serde_json something, might as well commit this. Change-Id: I60f87aa3180f750fa171eca7f9c375ed053f8456 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2537 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-14 r/2216 feat(users/Profpatsch/netencode-rs): run tests with testRustSimplesterni1-15/+10
The rust tests are now automatically built and run if users.Profpatsch.netencode-rs is built without changing the content of its output. users.Profpatsch.netencode-rs-tests has been removed in favor of this, but can still be accessed as builtins.head users.Profpatsch.netencode.netencode-rs.drvDeps Change-Id: I25e8191f5b9efa08ace4a584a75978565c79d8d0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2530 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
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>