!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

326 Members
https://github.com/nix-community/NixOS-WSL55 Servers

Load older messages


SenderMessageTime
26 Aug 2025
@ptramo:matrix.orgPierre Carrierwow, everyt00:04:37
@ptramo:matrix.orgPierre Carrier* wow, everything kinda just works hu00:04:48
@ptramo:matrix.orgPierre CarrierI know very little of what was required, but kudos00:05:04
@ptramo:matrix.orgPierre Carriersorry, this is off topic, but if I want to ssh into my nixos-wsl from anywhere, is there much I have to do? I use networkingMode mirrored. unfortunately interacting with this particular install is rather time consuming and difficult so I can't tinker fast17:28:12
@k900:0upti.meK900I'd maybe just run something like Tailscale inside the VM17:28:39
@ptramo:matrix.orgPierre Carrierperfect. and to make sure the VM is always running?17:29:13
@k900:0upti.meK900There's a setting in .wslconfig for how long the VM is kept alive for17:29:43
@ptramo:matrix.orgPierre Carrierthanks. that and a startup script to run wsl exit 0 should do it then17:30:14
@ptramo:matrix.orgPierre Carrieryup I'm all set I believe. thanks so much17:35:53
@ptramo:matrix.orgPierre Carrieronce I have a fully running system, can I image it using nix? not a fork of the nixos-wsl repo but everything in my flake: system config, user with home-manager, etc. I'd like to be able to restore my system in one command without exporting with wsl which lives temp files etc. in the backup17:37:39
@ptramo:matrix.orgPierre Carrier* once I have a fully running system, can I image it using nix? not a fork of the nixos-wsl repo but everything in my flake: system config, user with home-manager, etc. I'd like to be able to restore my system in one command without exporting with wsl which leaves temp files etc. in the backup17:37:52
@k900:0upti.meK900What do you mean by "image"?17:38:10
@k900:0upti.meK900Generate a NixOS config from a system that you set up manually? No17:38:18
@ptramo:matrix.orgPierre Carriercreate a .wsl file17:38:19
@k900:0upti.meK900Build a .wsl file from a NixOS config (with the WSL modules included)? Yes17:38:37
@ptramo:matrix.orgPierre Carrierthat I can restore on other machines in as little time as possible. double click and go17:38:40
@nzbr:nzbr.denzbr (they/it) It should be possible (wsl --export I think), but I don't know if it will work well 17:39:34
@k900:0upti.meK900I think what they want is to build a tarball17:40:08
@k900:0upti.meK900Which is yes a thing you can do17:40:13
@ptramo:matrix.orgPierre Carrieryeah --export has all the transient stuff I'd rather lose17:40:20
@nzbr:nzbr.denzbr (they/it)Building a .wsl file from your own config should work fine though. But I don't remember the command for doing that without flakes17:40:28
@ptramo:matrix.orgPierre Carrieras in, not carry around17:40:35
@ptramo:matrix.orgPierre CarrierI use flakes17:41:07
@k900:0upti.meK900 It should be nix-build <nixpkgs/nixos> -A config.system.build.tarballBuilder 17:41:04
@ptramo:matrix.orgPierre Carrierhttps://github.com/pcarrier/nix17:41:20
@k900:0upti.meK900 Then it should be nix build .#nixosConfigurations.<hostname>.config.system.build.tarballBuilder 17:41:22
@ptramo:matrix.orgPierre Carrierah perfect appreciate it17:48:07
@nzbr:nzbr.denzbr (they/it) Does that automatically know to look in /etc/nixos/configuration.nix? 17:50:23
@k900:0upti.meK900Yes17:52:03
@nzbr:nzbr.denzbr (they/it)Neat17:52:10

Show newer messages


Back to Room ListRoom Version: 9