about summary refs log tree commit diff
path: root/nix (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-26 r/1719 fix(readTree): Add __readTree attribute to foldersVincent Ambo1-1/+1
This is required to automatically walk the tree (see subsequent commits). Note: Lisp packages are removed from the CI builds in this commit because the attrValues of third_party.lisp will contain an element that is simply `true`, which causes a type error. These packages are re-added when CI refactoring is complete. Change-Id: I21e2b719e6c7161c23d2867a216f4daa1c6c8394 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1848 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-23 r/1706 feat(nix/buildLisp): Expose an sbcl attributeGriffin Smith1-4/+6
Expose an `sbcl` attribute on packages and programs, to allow for easier development either with SLY or on a REPL. Change-Id: Ide4d087a5223561e1fe192ef32dc593c54b5a20e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1834 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-08-20 r/1683 feat(tools/depot-scanner): init projectKane York1-2/+2
depot-scanner is a tool that runs Nix and parses the --trace-file-access output to deduce what files are necessary to evaluate a derivation. Take DEPOT_ROOT from the environment. If depotRoot doesn't exist, print an error early. Fix the build of the protobuf library. Switch to the GRPC build rule, as a service is in this proto file. Create the PathType enum and parse it from cmdline flags. Change-Id: I537b5c6bceecf76ca510f7ac04ab9dad7785feb1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1769 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-08-04 r/1586 feat(nix/readTree): allow arguments to depend on tree locationedef1-3/+3
This accepts a function for args, and passes it an attrset containing the locatedAt parameter. Change-Id: I3c0f8ca00605e02a787fda88f32b06f5ef9998f2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1639 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-08-04 r/1585 chore(nix/fetchGoModule): don't move downloaded fileedef1-3/+1
unzip(1) doesn't care about the extension, unlike the unpackFile hook. Change-Id: Ia9d0e17c4b343ee5d32350329eb6267b9dc35605 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1641 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <mail@tazj.in>
2020-08-04 r/1584 chore(nix/fetchGoModule): remove overrideAttrs hackedef1-5/+3
This was based off fetchzip, but unlike fetchzip we don't need to support arbitrary archive formats, so we don't actually need the unpack hooks. Change-Id: I5655c031f420422f13e72bb79f4b4b95f6f1204e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1640 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <mail@tazj.in>
2020-08-04 r/1580 chore: simplify buildGo expressionsedef1-3/+3
This removes redundant `map (p: p.gopkg)` expressions. Change-Id: If25d603c27d63ae011f396caf5d26cdfdb8c28d5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1625 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-08-04 r/1579 feat(nix/buildGo): use gopkg attribute of depsedef2-3/+3
This removes the need for `map (x: x.gopkg)` in dependency lists. Change-Id: Ia19e51f14110bf22f5cdbb64fa7ce182e1b34241 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1624 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-08-04 r/1578 feat(nix/buildGo): expose gopkg attribute on buildGo.packageedef1-7/+13
This makes the derivations more uniform, since both third-party packages generated by buildGo.external and native buildGo.package expose their libraries as gopkg attributes now. Change-Id: I547f9860082f36e3300139bf67613eb4fc600d24 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1623 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-08-03 r/1561 fix(nix/fetchGoModule): correctly case-fold mixed-case package pathsedef1-2/+14
Change-Id: I5a93462a23bf3c9f22fc3de0b173763a9bc8d526 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1591 Tested-by: BuildkiteCI Reviewed-by: edef <edef@edef.eu>
2020-08-03 r/1559 chore(nix/fetchGoModule): Move //users/edef/fetchGoModule to //nixedef2-0/+26
Change-Id: Ie7f52367ef91c0c8017a36c2a6c7edb06f10e57d Reviewed-on: https://cl.tvl.fyi/c/depot/+/1589 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-27 r/1492 feat(nix/buildLisp): Add abstraction for test suitesGriffin Smith2-50/+142
Add support for explicitly specifying tests as part of a buildLisp program or library. Change-Id: I733213c1618f0fa60f645465560bce0522641efd Reviewed-on: https://cl.tvl.fyi/c/depot/+/1481 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-26 r/1487 fix(nix/buildLisp): Set LANG to C.UTF-8 on program buildsGriffin Smith1-0/+1
This was already happening for libraries, but not for programs - as a result, programs built with libraries that contained unicode (eg cl-unicode, uax-15, ...) would fail to build due to character encoding issues when loading the FASLs. Change-Id: I66149b585e85b213d0c026153140a1925536bd29 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1469 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-20 r/1407 fix(buildTypedGo): Use builtins.baseNameOf when renaming inputsVincent Ambo1-1/+2
Without this, we would end up with "double" store paths like this: /nix/store/848js1fvbjniv5n00hifmhgzzszl97vv--nix-store-ad6piq18wdkxnfzsbyn88ixvv7gfb1dp-main.go.drv We really only care about the `main.go` bit though. Change-Id: Ib0644781a0e232a45e1cae3dd05b9b828c9087ee Reviewed-on: https://cl.tvl.fyi/c/depot/+/1321 Tested-by: BuildkiteCI Reviewed-by: ericvolp12 <ericvolp12@gmail.com>
2020-07-17 r/1366 feat(ci): run buf check lint in CIKane York1-0/+9
Breaking change detection will run but not enforce. Emoji of water buffalo was chosen by @pedge fiat in the bufbuild slack. Change-Id: Ie292f2bfddc0e3bc512e4a138c0b5d0fa2603bad Reviewed-on: https://cl.tvl.fyi/c/depot/+/1247 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-17 r/1351 fix(nix/buildGo/example): use correct package nameKane York1-1/+1
Change-Id: Ie191e4154afe5aa47bb9ea5322010db014a1fa42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1246 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-06 r/1228 fix(buildLisp): use full store path in FASL output pathnameseta1-1/+1
If you compiled dirA/test.lisp and dirB/test.lisp in the same library, they'd both get written to /test.fasl and the second would overwrite the first. Instead, use the whole store path (with / swapped for -) as the fasl filename. Change-Id: I4eb88b5d33757751e1f67e72ed328bd58079b1b9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/944 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-06-30 r/1133 refactor(nix): use our own writeScript(Bin)Profpatsch7-23/+46
We have this nice `runExecline` now, so we don’t need to use `runCommand` (which spawns bash) just to write a simple script. Change-Id: I2941ed8c1448fa1d7cc02dc18b24a8a945b2c38b Reviewed-on: https://cl.tvl.fyi/c/depot/+/704 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: BuildkiteCI
2020-06-29 r/1132 feat(nix/runExecline): add runExeclineProfpatsch4-0/+251
runExecline is a primitive that just does not care. It’s similar to `runCommand`, but instead of concatenating bash scripts left and right, it actually *uses* the features of `derivation`, passing things to `args` and making it possible to overwrite the `builder` in a sensible manner. Additionally, it provides a way to pass a nix string to `stdin` of the build script. Similar to `writeExecline`, the passed script is not a string, but a nested list of nix lists representing execline blocks. Escaping is done by the implementation, the user can just use normal nix strings. Change-Id: I890d9e5d921207751cdc8cc4309381395d92742f Reviewed-on: https://cl.tvl.fyi/c/depot/+/701 Reviewed-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-06-29 r/1131 refactor(nix/escapeExecline): move into own directoryProfpatsch3-30/+34
The escaping functions are going to be used by both `writeExecline` and `runExecline`, so let’s move them to their own namespace. Change-Id: Iccf69eaeca3062573e0751a17c548b7def86196d Reviewed-on: https://cl.tvl.fyi/c/depot/+/706 Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Kane York <rikingcoding@gmail.com>
2020-06-28 r/1108 feat(nix/emptyDerivation) add emptyDerivationProfpatsch4-0/+89
The most trivial of all derivations. It is more useful than it looks. Can be used to bind nix expressions (e.g. test suites) to a derivation, so that `nix-build` does not crap itself. Change-Id: I61c24d8c129c9505733161207f3c30e820f5b15e Reviewed-on: https://cl.tvl.fyi/c/depot/+/665 Reviewed-by: tazjin <mail@tazj.in>
2020-06-28 r/1107 feat(nix/getBins): add getBinsProfpatsch3-0/+91
This is a simple-stupid “unix import system” for nix, for referencing binaries in `/bin/` by their name and lifting them to a Nix attrset. Allows for simple aliasing of executable names. Change-Id: Ifa23cb377201c3b08050c5026e9751e736afaf56 Reviewed-on: https://cl.tvl.fyi/c/depot/+/664 Reviewed-by: tazjin <mail@tazj.in>
2020-06-28 r/1104 feat(nix/runTestsuite): add runTestsuiteProfpatsch1-0/+121
This is a very simple test suite for nix expressions. It should help us set up a good suite of unit tests for our nix-based stuff. Since we allow import from derivation, these tests can also depend on derivations and e.g. use `builtins.readFile` to check outputs. This is a first PoC to get us going, we can always replace it by something different in the future if we don’t like it. Change-Id: I206c7b624db2b1dabd9c73ffce4f87e658919958 Reviewed-on: https://cl.tvl.fyi/c/depot/+/662 Reviewed-by: tazjin <mail@tazj.in> Tested-by: tazjin <mail@tazj.in>
2020-06-27 r/1103 feat(nix/yants): add unit typeProfpatsch2-0/+2
Has one less value than bool. Change-Id: I2f2db07b1eb1f49172942bc1d8c6ceb30d987d84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/661 Reviewed-by: tazjin <mail@tazj.in>
2020-06-27 r/1100 feat(nix/writeExecline): add writeExeclineProfpatsch2-0/+70
This is a writer, similar to `pkgs.writeBashScript` or `pkgs.writers.writePython3`. The difference is that we can correctly write all execline scripts by using nix lists of lists, so the user doesn’t have to care about escaping arguments (like they have to in bash scripts with `lib.escapeShellArg` for example). Change-Id: I2f2874cf61170ddca07b89b692f762725f4a75dc Reviewed-on: https://cl.tvl.fyi/c/depot/+/625 Reviewed-by: Kane York <rikingcoding@gmail.com> Reviewed-by: tazjin <mail@tazj.in>
2020-06-27 r/1097 feat(nix/binify): add binifyProfpatsch1-0/+16
Create a store path where the executable `exe` is linked to $out/bin/${name}. This is useful for e.g. including it as a “package” in `buildInputs` of a shell.nix. For example, if I have the exeutable /nix/store/…-hello, I can make it into /nix/store/…-binify-hello/bin/hello with `binify { exe = …; name = "hello" }`. Change-Id: I600bdcd8f143bca2dd8dfbb165a9a5a8d6397622 Reviewed-on: https://cl.tvl.fyi/c/depot/+/624 Reviewed-by: tazjin <mail@tazj.in>
2020-06-19 r/1038 fix(buildTypedGo): Pass correct arguments to .packageVincent Ambo1-2/+2
Change-Id: I535e084e7b3195628609bb43e382e450bc0003ba Reviewed-on: https://cl.tvl.fyi/c/depot/+/497 Reviewed-by: eta <eta@theta.eu.org> Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-06-18 r/1017 feat(nix/buildTypedGo): Add a //nix/buildGo wrapper for typed GoVincent Ambo3-0/+56
These functions work like buildGo.program & buildGo.package, but run the .go2 sources through go2go first before passing them to the //nix/buildGo equivalents. Change-Id: Id1ebab6085c390d6986387370181377b9f5d39e8
2020-06-15 r/965 fix(nix/buildGo): Fix import of buildGo in example fileVincent Ambo1-1/+1
Change-Id: I56b4d19f24c5d8ec45254b7b05c9e49002d2ef85 Reviewed-on: https://cl.tvl.fyi/c/depot/+/382 Reviewed-by: edef <edef@edef.eu>
2020-06-13 r/939 fix(nix/readTree): Ignore hidden files and directoriesedef1-3/+14
This skips any directory entries starting with a dot. Change-Id: I95767f3d35bcb2ed9b3d6e772f3924dd57612711 Reviewed-on: https://cl.tvl.fyi/c/depot/+/123 Reviewed-by: tazjin <mail@tazj.in>
2020-06-13 r/928 fix(nix/buildGo/external): Properly match import path prefixesedef1-1/+1
Prior to this patch, github.com/hashicorp/terraform-svchost is erroneously considered a sub-package of github.com/hashicorp/terraform, breaking dependency searching: error: missing local dependency 'github.com.hashicorp.terraform-svchost' in 'github.com/hashicorp/terraform' Change-Id: Ibcf0f3a9b1742ce46f84cbbf84e90127b8c1df0d Reviewed-on: https://cl.tvl.fyi/c/depot/+/122 Reviewed-by: tazjin <mail@tazj.in>
2020-06-13 r/925 fix(nix/buildGo): Pass sane arguments to log.Fatalfedef1-1/+1
Change-Id: Ie0f2c0a50d8c0618abf6dae2242155fdf1f98e2b Reviewed-on: https://cl.tvl.fyi/c/depot/+/121 Reviewed-by: tazjin <mail@tazj.in>
2020-05-25 r/848 fix(nix/buildGo): Do not silently ignore filepath.Walk() errorsVincent Ambo1-0/+4
2020-05-16 r/720 docs(nix/yants): Mention Yants subtree split in READMEVincent Ambo1-5/+9
This subtree split makes it possible for people to clone only yants (similar to the kontemplate and journaldriver branches). The subtree continues the history of the old git repository.
2020-03-31 r/606 fix(nix/buildGo): Remove absolute references to GOROOT from binariesVincent Ambo1-0/+1
Setting the GOROOT_FINAL environment variables replaces the absolute location of the Go standard library sources in the final build artefacts with a fake location (in this case starting with go/src/...). This is despite the documentation for 'trimpath' (in 'go tool compile') stating that it would affect all source paths: That's only true for user code! I figured this out by reading through the implementation of the other 'trimpath' (in 'gob build'): https://go-review.googlesource.com/c/go/+/173345
2020-02-21 r/559 chore: Rename pkgs->depot in all Nix file headersVincent Ambo4-9/+8
2020-02-11 r/543 fix(nix/tailscale): Fix incorrect Tailscale ACL config typeVincent Ambo1-3/+14
2020-02-11 r/537 feat(nix/tailscale): Add function for generating tailscale ACLsVincent Ambo1-0/+19
... and use it on Camden!
2020-02-07 r/481 docs(nix/yants): Fix screenshot URLsVincent Ambo1-5/+5
The URLs served on the /about page are relative to the path's dirname, which is tree/nix not tree/nix/yants.
2020-01-29 r/473 fix(nix/buildLisp): Ensure SBCL uses UTF-8 encodingVincent Ambo1-0/+1
2020-01-29 r/471 docs(nix/buildLisp): Update the README with actual docsVincent Ambo2-12/+87
2020-01-26 r/461 feat(nix/buildLisp): Add 'bundled' function for built-in librariesVincent Ambo1-0/+8
Makes it possible to add virtual dependencies on built-in libraries, e.g. `buildLisp.bundled "sb-posix"`.
2020-01-24 r/455 chore(buildLisp): use lib.optionalString where applicableedef1-4/+1
2020-01-24 r/454 chore(buildGo): use lib.optionalString where applicableedef1-1/+1
2020-01-17 r/386 fix(nix/buildLisp): Don't load binaries in sbclWithVincent Ambo1-3/+11
Adds an attribute on each Lisp derivation that specifies whether it is a binary or not. This attribute is then filtered for in sbclWith.
2020-01-17 r/385 feat(nix/buildLisp): Support passing programs to sbclWithVincent Ambo1-1/+1
Adds the necessary attributes on derivations created by buildLisp.program for them to be passed to buildLisp.sbclWith. This makes it possible to easily spin up Lisp environments that contain everything needed for a given program.
2020-01-09 r/365 fix(buildLisp): Wrap executables to set load paths correctlyVincent Ambo2-16/+10
I can not currently find a way to set the CFFI variables correctly to get it to load libraries from Nix. In the absence of that feature, a wrapper also does the trick.
2020-01-09 r/364 feat(buildLisp): Initial implementation of foreign library loadingVincent Ambo1-9/+46
Adds a new 'native' parameter to the buildLisp functions in which libraries can be passed in. This does not yet work with CFFI packages.
2020-01-09 r/355 fix(buildLisp): Perform a topological sort of dependenciesVincent Ambo1-8/+7
This ensures that dependencies are loaded in the correct order in larger dependency graphs.
2020-01-08 r/351 fix(buildLisp): Cursed code to fix load orderingVincent Ambo1-10/+23
It's not enough to compile in the right order - turns out you also have to load the compiled objects in the right order. To achieve this some cursed code has been added that changes the Lisp generated by Nix to compile the other Lisp so that it also generates some bash, which Nix can then use to concatenate the FASLs in the right order to feed them to Lisp again. It works but I'll replace it with a more elegant solution once one is needed.