Nix Flakes | 885 Members | |
| 179 Servers |
| Sender | Message | Time |
|---|---|---|
| 19 May 2023 | ||
| howdy, i have a flake i use for a devShell containing dotnet, nuget, and omnisharp, and i'm wondering how i can prevent these dependencies from clogging up
one thing i've been suggested is to use https://github.com/queer/boxxy, which i'm not against, but i would prefer something native to Nix. supposedly i can fiddle with | 18:40:24 | |
| hmm, I don't think this is really within the domain of Nix, to be honest - as it essentially concerns runtime isolation, and Nix only really concerns itself with build/install-time stuff | 18:50:49 | |
| both in the sense that I don't think Nix really has tools for this, and in the sense that using arbitrary tools like boxxy wouldn't interfere with Nix usage | 18:51:16 | |
| on NixOS, you could use systemd's container spawn stuff and there's even some declarative NixOS container stuff, but that doesn't help you outside of NixOS, and that's more meant for services than for on-demand applications I think | 18:52:38 | |
| (though of course the container spawning should be available on any systemd system, but by that point Nix is no longer involved) | 18:53:05 | |
| one thing you could do on a Nix level is actually patch their packages to hardcode a different folder where stuff goes, instead of $HOME, but that'd be software-dependent changes | 18:53:43 | |
| and probably quite a bit more work than "just throw a tool like boxxy at it" :p | 18:54:22 | |
| hmm. I guess you could patch packages so that instead of exposing the original binary, they expose a wrapper script pretending to be that binary, but actually it invokes it via boxxy | 18:59:16 | |
| as a built-in alias of sorts | 18:59:21 | |
| those are good points, i was hoping i could cast some Nix spells and be done with it 🥲 i do plan to share this with the team, but if i could package boxxy in with this flake and run a shell hook to encapsulate these dependencies i might get what i want. all speculation; i gotta try it first | 19:00:45 | |
| sandboxing spells are unfortunately only available in the NixOS Service Management Plus package :p | 19:02:17 | |
| would be cool to have a generic Nix utility for boxxy-fying arbitrary packages, though | 19:03:14 | |
| maybe if i cry loud enough someone will make a nix module out of it | 19:03:51 | |
| It Could Be You(tm) | 19:04:41 | |
| :p | 19:04:44 | |
| 21 May 2023 | ||
| 20:53:07 | ||
| 23 May 2023 | ||
Does anyone have an example nixos flake, with nixpkgs-config and nixpkgs-overlay, as described under Using nixpkgs.overlays from configuration.nix in https://nixos.wiki/wiki/Overlays? | 21:15:12 | |
| That should just work as normal and don't change with flakes unless you try to load something which would be considered impure | 22:31:03 | |
Sandro 🐧: I'm talking about having nix-build, nix repl and other nixpkgs tools use the same config and overlay as the nixos config. preferrably without setting anything into your home folder. are you positive that this works? | 22:47:34 | |
but nix-build and nix repl don't read nixpkgs | 22:52:50 | |
* but nix-build and nix repl don't read nixpkgs unless you tell it to | 22:53:01 | |
and if I do, it would read <nixpkgs-overlay> as well as NIXPKGS_CONFIG, in order to configure nixpkgs. And how would I best configure that with flake-based nixos config? | 22:56:56 | |
Particularly, how would I best make it so that it takes the same configs and overlays, as configured through nixos modules? The wiki section I referenced, has stub files that do import <nixpkgs/nixos> {}, but that doesn't work so well with flakes ... | 23:00:01 | |
In reply to @bendlas:matrix.orgyou can set nixpkgs-overlay in nix.nixPath | 23:08:14 | |
In reply to @bendlas:matrix.org* you can set nixpkgs-overlays in nix.nixPath | 23:08:26 | |
| and what would I set that to, in this scenario? | 23:08:54 | |
| probably to the path that has your overlays | 23:09:11 | |
In reply to @bendlas:matrix.org. | 23:09:20 | |
In reply to @bendlas:matrix.org* I don't have them in overlay files, but each module can add overlays and nixpkgs config as it needs to. | 23:11:15 | |
| you would probably want to put it in a file | 23:11:47 | |