14 Feb 2025 |
Charles | and here's an example of how it can be used: https://gitlab.computer.surgery/charles/sprinkles/-/blob/charles/wip/examples/greeter.nix?ref_type=heads | 21:48:57 |
Adam Chance |
there are currently zero docs Sounds like every project I've ever started
| 21:49:07 |
KFears (no longer human) | Saved this fornlater, looks cool | 21:49:08 |
Adam Chance | *
there are currently zero docs
Sounds like every project I've ever started
| 21:49:14 |
Charles | the charles/wip branch is currently blocked on this stupid bug: https://github.com/nix-community/nix-direnv/pull/549 | 21:49:28 |
K900 | It's weird and cool how your thing seems to do everything in Nix | 21:49:36 |
K900 | And my personal attempt at this did the exact opposite | 21:49:49 |
Charles | yeah it's just regular nix code, no secret sauce | 21:50:11 |
KFears (no longer human) | * Saved this for later, looks cool | 21:50:14 |
Charles | the main nix/lib dir doesn't depend on anything, not even nixpkgs | 21:50:25 |
Charles | * the main nix/lib dir doesn't depend on anything, not even nixpkgs, just builtins | 21:50:33 |
K900 | Yeah my take was to just get all the input fetching entirely outside of nix | 21:50:48 |
K900 | And then you just have a node_modules style thing | 21:51:05 |
Charles | my idea is basically to define a sort of schema for sources/inputs/outputs, and then punt the problem of pinning dependencies to something else | 21:51:28 |
K900 | I do kinda want to finish that PoC | 21:51:58 |
Charles | this is cool because you can use anything to manage sources: builtins.fetchGit /builtins.fetchTarball ,import , npins, even flakes via flake-compat | 21:52:00 |
K900 | Because it is like | 21:52:01 |
K900 | Weirdly cool | 21:52:03 |
K900 | The trick node_modules does basically works as-is on nix | 21:52:27 |
K900 | Which is very funny | 21:52:47 |
Charles | i don't know enough about node_modules to follow but it sounds intriguing | 21:52:50 |
KFears (no longer human) | My attempt that I was working on before the void has taken my laptop was a hybrid approach, where there's a Nix part and a Rust part | 21:52:55 |
K900 | In reply to@charles:computer.surgery i don't know enough about node_modules to follow but it sounds intriguing The short version is that if you have libfoo that depends on libbar, you just have node_modules/libfoo/node_modules/libbar | 21:53:22 |
K900 | And to import a dependency you just import ./node_modules/libfoo | 21:53:33 |
Charles | i see | 21:53:34 |
K900 | Which can then internally do import ./node_modules/libbar | 21:53:42 |
Charles | right | 21:53:51 |
Charles | clever | 21:53:56 |
K900 | And with a bit of symlink magic you can make it all resolve to basically a store | 21:53:59 |
Charles | windows users probably hate it | 21:54:09 |