<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?
<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>
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
<{^_^}>
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