!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

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

Load older messages


SenderMessageTime
20 Feb 2023
@nzbr:nzbr.deArson Copperflame We could just build two installers 🤷
nixos-wsl-installer.tar.gz and nixos-wsl-installer-legacy.tar.gz
22:53:55
21 Feb 2023
@ythakur:matrix.orgythakur joined the room.08:28:47
@k900:0upti.meK900n08:44:23
@k900:0upti.meK900 * Not sure I like that08:44:28
@k900:0upti.meK900Would get people even more confuse08:44:37
@k900:0upti.meK900 * Would get people even more confused08:44:39
@k900:0upti.meK900I have a kind of cursed idea08:44:54
@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

Show newer messages


Back to Room ListRoom Version: 9