!lTqhfnNvIkcEackxxk:matrix.org

Nix Bindings

86 Members
Nix C API https://github.com/NixOS/nix/blob/master/doc/manual/src/c-api.md, language-specific bindings, and their use cases (currently broken link: https://nixos.org/manual/nix/unstable/c-api)23 Servers

Load older messages


SenderMessageTime
30 Dec 2024
@roberthensing:matrix.orgRobert Hensing (roberth) Leonardo Santiago: we don't have much of a C API for the Store yet, but more importantly nix develop is architecturally unsound and we should move most of that logic to Nixpkgs anyway because of the bad coupling. See https://github.com/NixOS/nix/issues/7501 13:19:13
@roberthensing:matrix.orgRobert Hensing (roberth)So if you were to reimplement parts of develop with the C API, you'd end up duplicating those problems, and you won't support user-defined shell runners13:20:18
@roberthensing:matrix.orgRobert Hensing (roberth)(We would welcome additions to the libstore C API; that's not a problem)13:21:40
@o-santi:matrix.orgLeonardo Santiago
In reply to @roberthensing:matrix.org
So if you were to reimplement parts of develop with the C API, you'd end up duplicating those problems, and you won't support user-defined shell runners
yes, I very much noticed that, and I'd love if the environment variable handling logic was done entirely in nix
14:42:47
@o-santi:matrix.orgLeonardo Santiago the problem I'm trying to tackle is turning a derivation into a runnable shell. it seems to me that all that needs to be done is concatenating the buildInputs paths and running the shellHook as the --rcfile 14:51:13
@o-santi:matrix.orgLeonardo Santiago but looking at the develop c++ code, there are a bunch of stuff going on, including creating another derivation to export env vars as json, running it, parsing from json, and so on 14:52:50
@o-santi:matrix.orgLeonardo Santiagois there any simple way to replicate that behavior without having to mimic the c++ code? i don't really understand what constraints are at play here so for me it seems just overcomplicating for (seemingly) no reason, but I'm sure there's some motive behind all this14:54:27
31 Dec 2024
@zantonarthwyng:matrix.orgzantonarthwyng joined the room.01:10:59
1 Jan 2025
@zantonarthwyng:matrix.orgzantonarthwyng removed their display name zantonarthwyng.06:39:36
@zantonarthwyng:matrix.orgzantonarthwyng left the room.06:43:45
@butterbohn:matrix.orgbutterbohn joined the room.11:35:50
@butterbohn:matrix.orgbutterbohn left the room.13:05:59
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.14:26:12
2 Jan 2025
@error_pro:matrix.orgerror_pro joined the room.10:12:04
4 Jan 2025
@kranzes:matrix.orgIlan Joselevich (Kranzes) left the room.15:30:46
7 Jan 2025
@annatrans:matrix.org@annatrans:matrix.org joined the room.02:16:02
8 Jan 2025
@mjolnir:nixos.orgNixOS Moderation Bot banned @annatrans:matrix.org@annatrans:matrix.org (spam).11:57:18
10 Jan 2025
@o-santi:matrix.orgLeonardo Santiago what's the difference between nix_store_realise and nix_string_realise when the value is a derivation path? and is there a way to build multiple paths when the derivation itself can't be built? or do i need to just call nix_store_realise in a loop - this does not seem very efficient 14:12:30
@o-santi:matrix.orgLeonardo Santiago * what's the difference between nix_store_realise and nix_string_realise when the value is a derivation path? and is there a way to build multiple (input source) paths when the derivation itself can't be built? or do i need to just call nix_store_realise in a loop - this does not seem very efficient 14:12:43
@o-santi:matrix.orgLeonardo Santiago * what's the difference between nix_store_realise and nix_string_realise when the value is a derivation path? and is there a way to build multiple (input source) paths when the derivation itself can't be built? calling nix_store_realise in a loop does not seem very efficient 14:13:05
@alex:afuchs.deAlexander Fuchs left the room.15:02:44
@o-santi:matrix.orgLeonardo Santiago basically, is there any intent to add Store::buildPaths to the C API 16:16:43
11 Jan 2025
@pandapip1:matrix.orgpandapip1 joined the room.21:23:02
14 Jan 2025
@joerg:thalheim.ioMic92 I used nixstorerealize instead of buildPaths in the past 13:39:33
@joerg:thalheim.ioMic92 I used nix_store_realize instead of buildPaths in the past 13:39:49
15 Jan 2025
@roberthensing:matrix.orgRobert Hensing (roberth)contributions welcome06:19:41
@roberthensing:matrix.orgRobert Hensing (roberth) we do have nix_string_realise, in case your paths come from the same string in the expression language 06:20:43
@roberthensing:matrix.orgRobert Hensing (roberth)

what's the difference

The string one also works for strings that have multiple store paths in them, whereas nix_store_realise doesn't require the nix-expr library

06:22:58
@o-santi:matrix.orgLeonardo Santiagohonestly I have been thinking about contributing given the amount of time I have been reading nix source code the last couple of days, but I have literally 0 experience in C++ 15:23:43
@o-santi:matrix.orgLeonardo Santiagoand most of the code still confuses me, specially regarding inheritance and file importing that creates "spooky action from distance"15:25:04

Show newer messages


Back to Room ListRoom Version: 10