gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
pie___ has quit [Ping timeout: 250 seconds]
<elvishjerricco> Is there any kind of ad-hoc container program? Basically just an unshare wrapper that sets up a temporary root and the command line flags for you?
ottidmes has quit [Ping timeout: 272 seconds]
<elvishjerricco> ivan: "Need to be root." I thought `-U` was supposed to fix that, but doesn't appear to
pie__ has joined #nixos-chat
drakonis has joined #nixos-chat
<jasongrossman> ,jdwhat = "Did you mean jDwhat?"
<{^_^}> jdwhat defined
<gchristensen> what isn't so helpful ...
<drakonis> elvishjerricco, you might prefer to boot into the container rather than just gaining root
<drakonis> in case you need daemons and such
<elvishjerricco> drakonis: Mostly just looking for the ability to run something pretty ad-hoc and ephemeral, not set up a whole persistent config.
<elvishjerricco> Anyway, I can't figure out how to get `-U` to work so I don't need to run it as root
<elvishjerricco> It just says "Need to be root".
<drakonis> do -b
<drakonis> run as elevated
<elvishjerricco> Tried that
<drakonis> user namespaces still needs root
<elvishjerricco> Really? I thought they were unprivileged
<elvishjerricco> nixos-enter uses them and doesn't need root
<drakonis> unprivileged namespaces is something else
<elvishjerricco> Is there no way to use systemd-nspawn unprivileged?
<drakonis> "systemd-nspawn supports unprivileged containers, though the containers need to be booted as root." says the arch wiki
<drakonis> still needs to be rooted to run unprivileged
<elvishjerricco> That doesn't make sense
<drakonis> requires user namespaces for that one as well, hm didn't know that, thought it was separate
<elvishjerricco> Running as root means you're nont unprivileged
<drakonis> the container is
<drakonis> you can enable a flag for unprivileged as user
<drakonis> kernel.unprivileged_userns_clone
<drakonis> this lets them get run without being elevated, although i think it is a source of vulnerabilities, so it isn't on by default
<elvishjerricco> drakonis: Doesn't nixos-enter do the same stuff that systemd-nspawn needs?
<elvishjerricco> nixos-enter does not require root
<drakonis> "exec unshare --fork --mount --uts --mount-proc --pid $extraFlags -- "$0" "$@""
<drakonis> yeah i don't think it does that
<drakonis> it uses namespaces
<elvishjerricco> Isn't that using namespaces? That's what unshare is for
<drakonis> it doesn't use user namepsaces though
<elvishjerricco> Oh
<elvishjerricco> Got it
<elvishjerricco> $ unshare -U whoami
<elvishjerricco> nobody
<elvishjerricco> Doesn't seem like you need root for that?
<drakonis> you seem to have allowed unprivileged user namespace
<drakonis> because i have it disabled here and i am not allowed to do it while unrooted
<elvishjerricco> Alright. I haven't done that manually. Must be default in NixOS
<elvishjerricco> So
<elvishjerricco> Given that
<elvishjerricco> Why can't I use systemd-nspawn as non-root?
<drakonis> i didn't write it, go ask the systemd devs :V
hedning has quit [Ping timeout: 245 seconds]
sir_guy_carleton has joined #nixos-chat
drakonis has quit [Remote host closed the connection]
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 240 seconds]
lassulus_ is now known as lassulus
Guanin has quit [Remote host closed the connection]
sir_guy_carleton has quit [Quit: WeeChat 2.2]
jD91mZM2 has joined #nixos-chat
<jD91mZM2> gchristensen: Regarding your email, I'm afraid that rnix has sort of bad AST manipulation since the rowan rewrite. Although since you're writing ASTs from scratch you might be able to use https://docs.rs/rowan/0.1.3/rowan/struct.GreenNodeBuilder.html
<jD91mZM2> You said you wanted to combine code. If you mean combine as in adding new code somewhere, you can use https://docs.rs/rowan/0.1.3/rowan/struct.SyntaxNode.html#method.replace_with to replace one AST node with a completely new one
<jD91mZM2> If you want to add/remove an element from the AST, we have the helper function https://docs.rs/rowan/0.1.3/rowan/struct.SyntaxNode.html#method.with_children which replaces all the children
<jD91mZM2> Finally, there's a discord server with the rowan developer here: https://discord.gg/z6QTeXv. AST manipulation is still something we discuss there. If you have discord, your opinion could be helpful :)
<jD91mZM2> s/email/gitlab issue
endformationage has quit [Ping timeout: 240 seconds]
jasongrossman has quit [Ping timeout: 264 seconds]
ottidmes has joined #nixos-chat
jasongrossman has joined #nixos-chat
Synthetica has joined #nixos-chat
<joepie91> jD91mZM2: you've been busy :)
pie__ has quit [Ping timeout: 252 seconds]
<jD91mZM2> joepie91: If I need to rewrite that thing even one more time, I might go insane
<jD91mZM2> Luckily using a library means it's more likely the library will be changed/rewritten than it is that I'll have to do another rewrite
hedning has joined #nixos-chat
jD91mZM2 has quit [Ping timeout: 240 seconds]
Myrl-saki is now known as Myrly-kuri
jD91mZM2 has joined #nixos-chat
hedning has quit [Quit: hedning]
endformationage has joined #nixos-chat
pie__ has joined #nixos-chat
endformationage has quit [Ping timeout: 240 seconds]
<gchristensen> jD91mZM2: yeah, so I have some .nix files I'd like to load and merge with other Nix code, some of which I'd like to generate in Rust, some of which might come off the FS
<gchristensen> I don't have discord
<gchristensen> looks like I could do a pretty simple thing of just creating a new AST with { imports = [ nixA nixB nixC ]; } and accomplish most of my goals
<gchristensen> the absolute worst is using python or shell scripts to generate / merge Nix code, which means I get a syntax error 10 minutes in to a test cycle.
<joepie91> gchristensen: possibly https://www.npmjs.com/package/nijs may be relevant to what you want to do
Synthetica has quit [Quit: Connection closed for inactivity]
<samueldr> one lovely thing about this is the date of its announcement http://sandervanderburg.blogspot.com/2014/04/asynchronous-package-management-with.html
<samueldr> (which is *not* a coïncidence)
endformationage has joined #nixos-chat
sir_guy_carleton has joined #nixos-chat
jasongrossman has quit [Read error: Connection reset by peer]
<jD91mZM2> gchristensen: Oh I see. Good idea! You might need to manually construct an AST type using GreenNode::new sadly. Then once you have a SyntaxNode (SyntaxNode::new) you can just print it out, such as `println!("{}", ast);`. It implements Display
<jD91mZM2> The reason the AST builder might not work is because I don't think you can add an existing GreenNode to it. Maybe that's something that should be possible for a lot nicer manipulation
jD91mZM2 has quit [Quit: WeeChat 2.2]
Synthetica has joined #nixos-chat
pie___ has joined #nixos-chat
<pie___> I asked already in the main channel but I meant to ask here: there was some stuff somewhere on how to make ones own package sets? like language packages or whatever. gonna try to make a bit of progress today on something for WINE
<joepie91> pie___: overlays?
<pie___> well, im mostly not sure how i should even start with this
sir_guy_carleton has quit [Quit: WeeChat 2.2]
<joepie91> pie___: if an overlay is the route you want to go, this might be a useful inspiration: https://git.cryto.net/joepie91/morepkgs
<joepie91> also set up for (very simple) Hydra builds
<pie___> thanks ill take a look
<joepie91> (some of the entries are just aliases for nixpkgs stuff because they're not built by nixpkgs' hydra, and this way I can build them on my own build server)
<pie___> i think what i meant is 2) i need to figure out a way to manage wineprefixes as a prototype 1) how to structure things on the nix side: importing stuff, the actual package layout, idk
<joepie91> actually I don't think I'm doing that in this version yet
<pie___> btw are there any helpers for overlayfs?
<joepie91> ahhh
<joepie91> that;s a topic that I've been breaking my head on for a while, off-and-on
<joepie91> I don't have a good answer yet
<pie___> do you have any pointers
<pie___> oh haha i just ran into this https://github.com/NixOS/nixpkgs/issues/10165
<{^_^}> #10165 (by joepie91, 3 years ago, closed): WINE configuration?
<joepie91> :)
<joepie91> nothing specific yet, I got stuck on figuring out how to have Hydra build lots of stuff
<joepie91> I do have a few utility scripts for grabbing playonlinux metadata though
<joepie91> for wine versions and patches and such
<pie___> im looking at lutris as well
<pie___> im horrible at ever actually making progress on anything but i want to give it a shot
<joepie91> whoa, how did I not hear of that before
<pie___> i ran into it somewhat coincidentally, not sure why its not listed on the wine wiki
endformationage has quit [Ping timeout: 240 seconds]
<pie___> also i think its reeeelatively recent?
<pie___> i just asked in their channel where to find the installer scripts, dunno yet. (as per the readme in the git repo mentioning installer scripts)
<joepie91> last post on their site is 2 years ago lol
<joepie91> Lutris looks pretty much like the thing I wanted to build on top of Nix
<pie___> joepie91, wtf there isnt even a nix package for lutris!? ;P
<{^_^}> lutris/gens#1 (by jtrees, 1 year ago, open): Missing compile instructions
<pie___> ottidmes, ?
<ottidmes> pie___: well, you linked "missing compile instructions", and when I am in such a situation (or when the instructions are bad) I tend to check other distros
<pie___> ah, thats a good idea
<pie___> i wasnt sure why you linked a sega genesis emulator
<ottidmes> pie___: ah, like so, I thought they were a match, both named gens, both having the same version
<pie___> oh derp
<pie___> i linked something from a different repository
<pie___> i thought that was from lutris/lutris. my bad
<pie___> how do i get into the environment of a failing build so I can debug it?
<ottidmes> pie___: you cannot unless you explicitly say it has to keep the build around after failing
<pie___> i did pass -K
<ottidmes> pie___: well then: note: keeping build directory '/tmp/nix-build-python3.6-lutris-0.4.23.drv-1'
<pie___> but i would then like to run stuff with setup.py
<ottidmes> then you got to use nix-shell
<pie___> just running the same command with nix-shell f- ...well that worked this time
<pie___> i guess i wasnt paying attention
<pie___> thanks *shrug*
<pie___> maybe it was because i didnt pass -K to nix shell last time
<pie___> bbiab
pie___ has quit [Ping timeout: 260 seconds]