diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 2e26c9ee..53523803 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -7,7 +7,7 @@ - [Installation](./install.md) - [Design](./design.md) - [Building](./building.md) -- [How-To]() +- [How-To](./howto.md) - [Troubleshooting](./troubleshooting/README.md) - [Recovery Shell](./troubleshooting/recovery-shell.md) diff --git a/docs/src/howto.md b/docs/src/howto.md new file mode 100644 index 00000000..277f1602 --- /dev/null +++ b/docs/src/howto.md @@ -0,0 +1,29 @@ +# How-To + +## How to configure NixOS-WSL with flakes? +First add a `nixos-wsl` input, then add `nixos-wsl.nixosModules.default` to your nixos configuration. + +Below is a minimal `flake.nix` for you to get started: +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; + }; + + outputs = { self, nixpkgs, nixos-wsl, ... }: { + nixosConfigurations = { + nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + nixos-wsl.nixosModules.default + { + system.stateVersion = "24.05"; + wsl.enable = true; + } + ]; + }; + }; + }; +} +```