gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
jasongrossman has joined #nixos-chat
jtojnar has quit [Ping timeout: 255 seconds]
<elvishjerricco> What are the chances of switch-to-configuration ever being rewritten in something other than perl?
<gchristensen> good
lopsided98 has joined #nixos-chat
<gchristensen> Eelco would be +1 in principle in a rewrite to rust
<elvishjerricco> hm that's an interesting option, particularly since nixpkgs can cross compile rust now IIRC
<gchristensen> -1 in principle in a rewrite to another scriptey lang
<elvishjerricco> Fair enough. The bash in nixpkgs is already a little out of hand :P
<elvishjerricco> I'd personally like it to be done in haskell but that's probably too steep of a dependency
<gchristensen> there was a python rewrite PR but: scriptey
<elvishjerricco> yea one reason I'm interested in the switch is to make nixos closures < 100M, but python probably wouldn't help much there
<elvishjerricco> i can't believe perl is like 50M
<elvishjerricco> A preference for tools that are already part of the toolchain is a good point. That leaves.... C++?
<gchristensen> not required
<elvishjerricco> Yea, but it would be nice to not add new tools... Unless we have an interest in making rust commonplace in NixOS development
<joepie91> how complex is switch-to-configuration?
<elvishjerricco> It doesn't seem *too* completely horrible, but it's definitely a non-trivial to rewrite it
<elvishjerricco> Seems like the entire program is just sytemd logic; figuring out which units to stop start or reload.
<elvishjerricco> yea
<elvishjerricco> gchristensen: I think it might be possible to have systemd do the fstab stuff for us instead of having to parse it manually
<joepie91> gchristensen: is the +1 for a RIIR strong enough that it'd be worth it for me to have a go at it?
<joepie91> gchristensen: also taking into account architecture support etc. (I think we only officially support x86_64?)
<elvishjerricco> joepie91: I would be very appreciative :)
<samueldr> probably a good idea not to drop 32-bit compat (i686, armv7)
<gchristensen> joepie91: yeah
<elvishjerricco> These people are saying that restarting local-fs.target and remote-fs.target after daemon-reload will handle fstab fine: https://bbs.archlinux.org/viewtopic.php?pid=1526268#p1526268
<joepie91> gchristensen: has it been verified that Rust actually runs on all the platforms we want to not-break with NixOS? :)
<gchristensen> not necessarily :)
<elvishjerricco> arm is probably the only other one that really matters, right?
<joepie91> I dunno, hence asking
<joepie91> right
<joepie91> alright, I might have a go at it some time soon then
<samueldr> x86_64-pc-windows-msvc nixos when?
<joepie91> lol
<gchristensen> hmm good question actually
<joepie91> nooooot gonna take up that particular mantle of responsibility
<joepie91> :P
<gchristensen> I guess NixOS WSL is linux, not msvc?
<samueldr> yeah, WSL is definitely linux
<joepie91> well, Linux-like
<samueldr> the kernel is ABI compatible with linux
<gchristensen> cool
<gchristensen> joepie91: let's see it! :D
<samueldr> like I already ran nix on WSL
<elvishjerricco> Ive heard plenty of success stories with nix on WSL
<gchristensen> and NixOS on WSL
<samueldr> worked... can't say "fine" since it felt icky from windows, but worked nonetheless
<joepie91> gchristensen: also, who should I bother when I have questions about how something is done in switch-to-configuration.pl?
<samueldr> nixos on wsl doesn't work right now IIRC
* samueldr is digging up the issue
<joepie91> seems fairly straightforward but I may run across some "wut?"s anyway
<elvishjerricco> I thought WSL didn'thave unixy users? Isn't that a deal breaker for NixOS?
<gchristensen> joepie91: best bet would be to use me as a proxy to its main author, eelco :P
<{^_^}> Microsoft/WSL#3207 (by ghuntley, 43 weeks ago, open): [nixos] WslRegisterDistributionFailed: 0x800707b - ProcMon - CreateFile NAME INVALID
<joepie91> gchristensen: alright, will do that :)
<samueldr> >> If I understand this correctly the installation is failing because this image contains filenames or directories that cannot be expanded onto NTFS which is causing WslRegisterDistributionFailed to go boom
<gchristensen> I dunno
<gchristensen> I've seen it activate
<joepie91> gchristensen: first question: is the link that elvishjerricco posted a good solution for switch-to-configuration?
<joepie91> (that might save some porting work)
<gchristensen> joepie91: I would recommend not going that route... going bug for bug first.
<elvishjerricco> joepie91: Let me know if you make any progress. I'm very interested :P And although I can't imagine I'd be helpful, I'd be happy to help if need be.
<joepie91> good, that's two people on my list to bother with questions, this should go well :D
<joepie91> gchristensen: right, okay
<joepie91> I have to say, the switch-to-configuration code is surprisingly readable
<elvishjerricco> It does seem to be nicely commented
<gchristensen> perl doesn't have to be a nightmare
<elvishjerricco> I discovered that about C++ as well when I looked at the Nix source. For C++, that stuff is dreamy
<joepie91> more importantly, the comments that are there are largely "why does it do this" comments, not "what does it do"
<joepie91> :P
<gchristensen> Eelco is a really good developer!
<samueldr> // adds n to m
<samueldr> n + m
* joepie91 adds samueldr to quiet list
<joepie91> :P
<jasongrossman> Yeah, it's stupid to type comments saying what your code is doing like that, when there are automated systems that can do it for you.
<jasongrossman> n + m
<jasongrossman> // n + m
<samueldr> jasongrossman has n and m, coincidence?
<jasongrossman> samueldr: Redundancy isn't always bad.
<elvishjerricco> sed 's|\(\w*\) + \(\w*\)|// Adds \1 and \2|'
<elvishjerricco> joepie91: How will you deal with the macro "@foo@" thingies?
<joepie91> elvishjerricco: I presume those are env vars?
<jasongrossman> ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵
<joepie91> I don't really speak Perl, so
<joepie91> :P
<elvishjerricco> joepie91: They're substituted by Nix at build time using `substituteAll`
<gchristensen> pass most of them as arguments please :)
<joepie91> elvishjerricco: well that seems unuseful
<joepie91> I don't actually know yet how any of this ties together, so
<elvishjerricco> gchristensen: Lots of scripts rely on being able to plainly call `/nix/store/...-system/bin/switch-to-configuration switch` or something
<gchristensen> sure
<gchristensen> switch-to-configuration: #!/bin/sh ... /nix/store/hash-configuraiton-switcher/bin/switch --args --go --here
<gchristensen> but don't require the compile thing to be recompiled on every system generation
<elvishjerricco> ah, yea that's good
<elvishjerricco> though, as we've learned recently, putting all that in the shebang is probably not the best idea :P
<gchristensen> make the ... a \n :)
<elvishjerricco> ohhh
<samueldr> elvishjerricco: parse the shebang!
<samueldr> do a perl!
<elvishjerricco> lol
<joepie91> lol
<gchristensen> lol
lopsided98 has quit [Ping timeout: 250 seconds]
<joepie91> so, one derivation contains the compiled switcher that takes deps as arguments
<joepie91> and that derivation remains unchanged
<joepie91> then another derivation contains a substituted shell script that invokes the switcher
<joepie91> and that derivation gets built for every system rev
<joepie91> right?
<gchristensen> yea
<joepie91> ack
<joepie91> alright, time to sleep
<samueldr> shebang as #!/nix/store/.../bin/switch-to-configuration
<samueldr> but something like json (with first line skipped) for data transmission?
<elvishjerricco> joepie91: You could even make the changing file a json file, and use the rust program as the interpreter which reads a json file provided on cli
<samueldr> elvishjerricco: jinx
<elvishjerricco> oh
<samueldr> (that's a good idea I think!)
<elvishjerricco> both your names are orange for me, so I glossed over yours :P
<samueldr> funny, both your names are red here :)
<elvishjerricco> how long of a hostname would you need before the system derivation path becomes too long for a shebang?
<samueldr> between undefined and undefined :/
<joepie91> you both have different colors to me
<samueldr> for linux, 1024, might be infinite after the whole shebang shebang
<joepie91> and yeah, that could work
<joepie91> anyway, sleep!
<samueldr> g'sleep!
<joepie91> night
<elvishjerricco> samueldr: I thought the fix was to revert to truncating to like 256 bytes or something
drakonis_ has joined #nixos-chat
<samueldr> I wasn't sure of the actual number
<samueldr> but the fix was to revert to not failing the exec() call once it went over the limit
<samueldr> that's the main issue
<samueldr> the binary path wasn't close to hitting the limit
<samueldr> it was the parameters
<samueldr> and in the patch set adding that "fix" (the issue) it was described that they probably should move to parsing the shebang in a more flexible way, instead of a dumb sized buffer
drakonis has quit [Ping timeout: 268 seconds]
<elvishjerricco> ah. I wonder what breaks if they started parsing the full line no matter how long
<samueldr> that would be... quite the pickle
<elvishjerricco> in theory there could be a user with a flag that breaks their program just outside the truncation limit
<samueldr> definitely
<elvishjerricco> so it seems like this behavior may be here to stay?
<samueldr> it might
<samueldr> elvishjerricco: currently looks like 125 bytes for the interpreter name
<samueldr> (considering #! takes space)
<elvishjerricco> the whole thing, including the args?
<elvishjerricco> That's very little
<samueldr> interpreter name
<samueldr> so not including args, considering perl's behaviour
<samueldr> but yeah, that's including args in other cases
<elvishjerricco> yea so you have to be like perl for that limit to be enough
<samueldr> though IIRC POSIX itself has nothing about that
<samueldr> yes, this table is a case of "what year is this?"
drakonis has joined #nixos-chat
<elvishjerricco> lol legacy crap like this is why I hope redox os is considered good in 15 years
<samueldr> is Linux good after 27 years ;)
<elvishjerricco> I read some 20 year old things recently and was surprised to find that people considered it good after 7-8 years
lopsided98 has joined #nixos-chat
<mdash> redox doesn't deviate from posix design much does it?
drakonis has quit [Quit: WeeChat 2.3]
samueldr has quit [Ping timeout: 246 seconds]
samueldr has joined #nixos-chat
pie__ has joined #nixos-chat
pie___ has quit [Ping timeout: 255 seconds]
endformationage has quit [Quit: WeeChat 2.4]
vikingman has quit [Ping timeout: 240 seconds]
jackdk has quit [Ping timeout: 268 seconds]
Myhlamaeus has quit [Ping timeout: 252 seconds]
<sphalerite> https://www.gkware.com/ the video is quite fascinating
nckx has quit [Quit: Updating my GNU Guix server — https://guix.info]
nckx has joined #nixos-chat
johanot has joined #nixos-chat
johanot has quit [Quit: WeeChat 2.4]
__monty__ has joined #nixos-chat
johanot has joined #nixos-chat
jasongrossman has quit [Ping timeout: 252 seconds]
jasongrossman has joined #nixos-chat
<gchristensen> I've had a few people PM me about https://github.com/NixOS/nixops/pull/981 lately :') might need to keep going on it.
<{^_^}> nixops#981 (by grahamc, 34 weeks ago, open): Delete all the providers (and use plugins instead)
<jD91mZM2> How do you peeps have long running processes on your VPS instances? Keeping a script that re-launches all programs in their own tmux sessions is quite messy
<gchristensen> systemd services of course
<gchristensen> they're the cat's pajamas!
<jD91mZM2> User services, I suppose? Managed in home-manager?
<gchristensen> mostly no, usually I'll make a user for the service and run it as a system service
<gchristensen> maybe we should start with, what is the process?
<jD91mZM2> For example: a discord bot
<gchristensen> oh then I'd definitely set it up its own user :P
<jD91mZM2> Requirements: I'd want to be able to upload code changes quickly, and preferrably also stop it quickly to instead run locally
<jD91mZM2> That's cool. What's the win creating a new user per service though?
<gchristensen> less permission if they get compromised
<jD91mZM2> If you were to change this file, what do you run?
<gchristensen> well, `nixops deploy`
<gchristensen> but if not nixops, nixos-rebuild
<jD91mZM2> That settles it, I need to learn nixops :)
<gchristensen> nixops is pretty cool
<jD91mZM2> Oh and I almost forgot: gchristensen++
<{^_^}> gchristensen's karma got increased to 81
<gchristensen> lol :)
lnikkila has joined #nixos-chat
lnikkila has quit [Client Quit]
emily has quit [Ping timeout: 250 seconds]
jasongrossman has quit [Remote host closed the connection]
emily__ has joined #nixos-chat
emily__ is now known as emily
jasongrossman has joined #nixos-chat
endformationage has joined #nixos-chat
nckx has quit [Quit: Updating my GNU Guix server — https://guix.info]
nckx has joined #nixos-chat
johanot has quit [Quit: WeeChat 2.4]
jtojnar has joined #nixos-chat
waleee has joined #nixos-chat
emily has quit [Quit: Updating details, brb]
emily has joined #nixos-chat
drakonis has joined #nixos-chat
drakonis_ has quit [Ping timeout: 246 seconds]
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 252 seconds]
drakonis_ has quit [Ping timeout: 268 seconds]
drakonis_ has joined #nixos-chat
drakonis has joined #nixos-chat
drakonis1 has joined #nixos-chat
drakonis2 has joined #nixos-chat
drakonis_ has quit [Ping timeout: 252 seconds]
drakonis1 has quit [Ping timeout: 252 seconds]
drakonis has quit [Quit: WeeChat 2.3]
drakonis has joined #nixos-chat
drakonis2 has quit [Ping timeout: 268 seconds]
Myhlamaeus has joined #nixos-chat
manveru has quit [Ping timeout: 252 seconds]
yl[m] has quit [Ping timeout: 252 seconds]
sppky has quit [Ping timeout: 252 seconds]
manveru has joined #nixos-chat
yl[m] has joined #nixos-chat
<tilpner> \o/ My generation counter will have caught up to the current year soon
<steveeJ> and then you'll only update once per year
<gchristensen> haha
drakonis1 has joined #nixos-chat
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 250 seconds]
waleee has quit [Quit: WeeChat 2.4]
drakonis1 has quit [Quit: WeeChat 2.3]
drakonis has joined #nixos-chat
drakonis_ has quit [Ping timeout: 246 seconds]
<LnL> urgh, I hate python
<gchristensen> what's got you bitten?
<LnL> please give me a list of dependencies _without_ installing them
<gchristensen> lol
drakonis has quit [Read error: Connection reset by peer]
drakonis has joined #nixos-chat
<elvishjerricco> Does bluetooth do any kind of identity verification?
<LnL> oh I see, it's only if you use setuptools.setup, not the distutils one
jackdk has joined #nixos-chat
* LnL monkey patches some more
jtojnar has quit [Remote host closed the connection]
__monty__ has quit [Quit: leaving]