!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1167 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org189 Servers

Load older messages


SenderMessageTime
26 May 2021
@daiderd:matrix.orgLnLbut it's not a __impureHostDep, it's a runtime dependency so I don't get why you need this20:07:39
@daiderd:matrix.orgLnLit's the same on linux, you can't use pkgs.sudo at runtime you need the setuid wrapper which is available through PATH20:09:11
@abathur:matrix.orgabathurhmm, that may sink it20:11:36
@abathur:matrix.orgabathurI noticed that it works on Linux, though I haven't looked into how20:12:00
@abathur:matrix.orgabathuranyways; resholve's point/goal is nailing everything down at build time (and blocking if it can't), so the problem/need is unaffected by the suitability of the solution20:14:08
@daiderd:matrix.orgLnLsudo is a tricky one for that, since even on linux it can be either /run/wrappers/bin/sudo or /usr/bin/sudo20:16:09
@daiderd:matrix.orgLnLunless nix gets some kind of native support for setuid binaries20:16:35
@daiderd:matrix.orgLnLsame with eg. ping by the way20:18:18
@abathur:matrix.orgabathuredited the post to reframe it around what resholve needs wrt to the broader problem I guess21:18:04
@r_i_s:matrix.orgris_ one thing about the sandbox on darwin - i don't find i can disable it case by case on the command line even though i've set nix.trustedUsers = [ "*" ]; 22:58:52
@aaronjanse:matrix.orgaaronjanse joined the room.23:13:30
27 May 2021
@abathur:matrix.orgabathur LnL: is there an authoritative list? is it fair to take /run/wrappers/bin on NixOS as such? 00:02:24
@emilazy:matrix.orgemily there's no reason nix-darwin couldn't support /run/wrappers for compatibility right? 00:22:07
@emilazy:matrix.orgemily it already shoves /run into the hierarchy, might as well make use of it 00:22:20
@abathur:matrix.orgabathurit could, and that'd be an improvement, but I suspect it won't fix my core issue; the paths would still be invalid on macOS without nix-darwin, and probably on all other non-nixOS linuxes?00:26:25
@abathur:matrix.orgabathurand it's not just the lack of a ~well-known path, I guess, it's also somewhat about mental models and clarity?00:27:55
@abathur:matrix.orgabathurlike, ideally, resholve will rebuff you if you pass it any shell script that invokes anything that doesn't resolve to a keyword, builtin, alias, or function00:28:26
@abathur:matrix.orgabathurand the way to satisfy it is to explicitly pass your inputs00:28:44
@abathur:matrix.orgabathursorry; interrupted; so a magic hardcoded path for sudo (and probably some others) on Nix* is already a bit meh (not that I wouldn't make the pragmatic compromise...); it breaks the explicitness model and leaves the user with undeclared dependencies00:49:18
@abathur:matrix.orgabathurand if resholve's just trusting a magic path that isn't reachable from the build sandbox, it'll also mean disabling the check that the target exists and is executable, so it won't be able to successfully block on any cases where it doesn't :[00:51:57
@emilazy:matrix.orgemily
In reply to @abathur:matrix.org
it could, and that'd be an improvement, but I suspect it won't fix my core issue; the paths would still be invalid on macOS without nix-darwin, and probably on all other non-nixOS linuxes?
yeah, this is a problem not quite unique to sudo though :(
01:12:08
@emilazy:matrix.orgemilyif you grep /run/current-system/sw/bin in nixpkgs you can find a decent amount of hardcoding01:12:18
@emilazy:matrix.orgemilystuff that depends on system functionality ultimately ends up system-dependent01:12:33
@emilazy:matrix.orgemily
In reply to @abathur:matrix.org
like, ideally, resholve will rebuff you if you pass it any shell script that invokes anything that doesn't resolve to a keyword, builtin, alias, or function
I think the correct thing is to consider "sudo" part of the ABI between shell script and system
01:13:11
@emilazy:matrix.orgemily it's correct to rely on $PATH when the thing you specifically want is late-binding of the sudo belonging to the current execution environment 01:13:27
@emilazy:matrix.orgemilyso you should be able to tell resholve "treat sudo as system interface glue and allow it to pass through as if it's a built-in", say?01:13:46
@emilazy:matrix.orgemilyIt's like how on macOS, our binaries aren't statically linked, they contain late-bound references to all the libSystem stuff01:14:15
@emilazy:matrix.orgemily"where the sudo binary is" is part of the runtime system interface01:14:29
@abathur:matrix.orgabathurI'm not quite sure on the PATH part01:58:25
@abathur:matrix.orgabathurI'm not strictly opposed to treating it that way, but it is a violation of resholve's ~model and the promise it is trying to make; if it came down to that I'd be inclined to kick the can until enough actual resholve users exist to reach consensus about which behavior is right for their uses02:01:18

Show newer messages


Back to Room ListRoom Version: 6