!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

346 Members
https://github.com/nix-community/NixOS-WSL60 Servers

Load older messages


SenderMessageTime
21 Feb 2023
@k900:0upti.meK900We could have a small shim at /sbin/init in the installer that detects whether it's running as PID1 or not08:45:35
@nzbr:nzbr.deArson CopperflameThe installer would need to have /sbin/init anyway to work with native systemd. I don't even think it's that cursed - we just check if it's invoked08:48:02
@nzbr:nzbr.deArson CopperflameNow that I think about it, there's a potential race condition here08:48:49
@k900:0upti.meK900We can always boot the installer in non-native-systemd and rebuild later08:49:02
@k900:0upti.meK900And now I'm starting to wonder how small we can make the installer if we just include a Nix and let it bootstrap from there08:50:00
@nzbr:nzbr.deArson CopperflameI don't know how easy that would be though. But it might work, and if it does, we'd finally not have gigantic artifacts on every CI run08:52:48
@k900:0upti.meK900I don't see why it wouldn't work conceptually08:53:30
@k900:0upti.meK900But we'll need our own nixos-generate-config equivalent and such08:54:01
@nzbr:nzbr.deArson Copperflame All we need is a working nix and our config files, including the default configuration.nix (with one version for legacy and one for native). Then we can just build the toplevel derivation, run result/bin/switch-to-configuration boot and then hand off to systemd or syschdemd 08:56:45
@k900:0upti.meK900We probably want to power off the VM08:57:23
@k900:0upti.meK900In case we're switching to native systemd08:57:30
@nzbr:nzbr.deArson CopperflameI'd just do all of that in init then, to be honest. So the installer always has systemd set to enabled, and detects whether or not it's been started as init or as a shell. It can then select the appropriate config template and hand off to the correct implementation once it's finished08:59:45
@nzbr:nzbr.deArson CopperflameI know, that won't have any log output, but Windows users are used to staring at black screens telling them that it's "Getting Ready" or something, lol09:01:13
@k900:0upti.meK900The problem with that is that it'll be invoked as both an init and a shell09:01:19
@k900:0upti.meK900If it's the same thing09:01:32
@nzbr:nzbr.deArson CopperflameWe could add a generous timeout if it's in a shell so that if it's also started as init it will do something like print "Please wait while we're setting up your brand new NixOS experience (tm)" or cat dmesg09:03:08
@k900:0upti.meK900I was actually thinking the other way around09:03:33
@k900:0upti.meK900If it's started as init, just have it do nothing09:03:44
@k900:0upti.meK900And maybe set a flag09:03:48
@k900:0upti.meK900And if it's started as a shell, we can do interactive stuff09:03:59
@k900:0upti.meK900Kinda09:04:00
@nzbr:nzbr.deArson CopperflameIt could touch some file, and once the file is deleted it resumes to systemd. But then we'd still need to find out if it has been started ad all09:04:42
@k900:0upti.meK900I have an even more cursed idea09:05:30
@k900:0upti.meK900 We can just call wsl.exe --version over interop 09:05:39
@k900:0upti.meK900And know the version number09:05:48
@nzbr:nzbr.deArson CopperflameI was thinking about that as well, but I don't think the output of that is stable. They completely changed it when switching to the store version and it's translated to the Windows display language, which might give us new and exciting encoding problems09:08:15
@k900:0upti.meK900There's also the obvious version of "just ask"09:08:53
@k900:0upti.meK900But that might confuse people09:09:02
@nzbr:nzbr.deArson Copperflame
In reply to @k900:0upti.me
There's also the obvious version of "just ask"
That sounds like some preventable bug reports
09:10:17
@nzbr:nzbr.deArson CopperflameCould we just find out what executable PID 1 currently is?09:11:46

Show newer messages


Back to Room ListRoom Version: 9