Skip to content

Commit 7ac61b2

Browse files
committed
Update README
Closes #13
1 parent aedeea6 commit 7ac61b2

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

README.rst

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,23 @@ DistroLauncher_ as ``install.tar.gz`` or as input to ``wsl --import --version
1010
Quick start
1111
===========
1212

13-
First, you need to build the rootfs tarball. That can be done in some existing
14-
Nix installation. If you don't have one, `you can install Nix in an existing
15-
Linux installation such as Ubuntu on WSL
16-
<https://nixos.org/download.html#nix-quick-install>`_. Alernatively, you can
17-
also use the `nixos/nix Docker container <https://hub.docker.com/r/nixos/nix>`_.
13+
First, `download the latest release's system tarball
14+
<https://github.com/Trundle/NixOS-WSL/releases/latest/download/nixos-system-x86_64-linux.tar.gz>`_.
1815

19-
Run the following commands in your Nix-enabled system:
16+
Then open up a Terminal, PowerShell or Command Prompt and run::
2017

21-
- ``git clone https://github.com/Trundle/NixOS-WSL``
22-
- ``cd NixOS-WSL``
23-
- ``$EDITOR configuration.nix`` and change the ``defaultUser`` variable to whatever you want
24-
- ``nix-build -A system -A config.system.build.tarball ./nixos.nix``
18+
wsl --import NixOS .\NixOS\ nixos-system-x86_64-linux.tar.gz --version 2
2519

26-
After that, the rootfs tarball can be found under
27-
``result-2/tarball/nixos-system-x86_64-linux.tar.gz``. Copy the file to your
28-
Windows installation. If you used another WSL distribution to build the tarball,
29-
that can be done with the following commands:
20+
This sets up a new WSL distribution ``NixOS`` that is installed under
21+
``.\NixOS``. ``nixos-system-x86_64-linux.tar.gz`` is the path to the file you
22+
downloaded earlier. You might need to change this path or change to the download
23+
directory first.
3024

31-
- ``mkdir "/mnt/c/Users/[Windows username]/NixOS"``
32-
- ``cp result-2/tarball/nixos-system-x86_64-linux.tar.gz "/mnt/c/Users/[Windows username]/NixOS/"``
25+
You can now run NixOS::
3326

34-
Open up a Command Prompt or PowerShell and run:
27+
wsl -d NixOS
3528

36-
- ``wsl --import NixOS .\NixOS\ .\NixOS\nixos-system-x86_64-linux.tar.gz --version 2``
37-
- ``wsl -d NixOS``
38-
39-
You will be dropped into a very primitive ``sh`` shell, from here you need to
29+
You will be dropped into a very primitive ``sh`` shell. From here you need to
4030
run this once::
4131

4232
/nix/var/nix/profiles/system/activate
@@ -64,12 +54,25 @@ combination is resolved in two ways:
6454
wrapper (see above) enters the systemd namespace before dropping to the shell.
6555

6656

67-
How to build
68-
============
57+
Build your own system tarball
58+
=============================
59+
60+
This requires access to a system that already has Nix installed. Please refer to
61+
the `Nix installation guide <https://nixos.org/guides/install-nix.html>`_ if
62+
that's not the case.
63+
64+
If you have a flakes-enabled Nix, you can use the following command to buld your
65+
own tarball instead of relying on a prebuilt one::
66+
67+
nix build github:Trundle/NixOS-WSL#nixosConfigurations.mysystem.config.system.build.tarball
68+
69+
Or, if you want to build with local changes, run inside your checkout::
70+
71+
nix build .#nixosConfigurations.mysystem.config.system.build.tarball
6972

70-
::
73+
Without a flakes-enabled Nix, you can build a tarball using::
7174

72-
$ nix-build -A system -A config.system.build.tarball ./nixos.nix
75+
nix-build -A system -A config.system.build.tarball ./nixos.nix
7376

7477
The resulting mini rootfs can then be found under
7578
``./result-2/tarball/nixos-system-x86_64-linux.tar.gz``.

0 commit comments

Comments
 (0)