A nixos configuration that works with VS Code in WSL
{
inputs.nixos-wsl-vscode.url = "github:Atry/nixos-wsl-vscode";
outputs = { self, nixpkgs, nixos-wsl-vscode }: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
modules = [
nixos-wsl-vscode.nixosModules.vscodeServerWsl
({ config, pkgs, ... }: {
# rest of your configuration
})
];
};
};
}
{ config, pkgs, ... }: {
imports = [
(builtins.getFlake "github:Atry/nixos-wsl-vscode").nixosModules.vscodeServerWsl
];
# rest of your configuration
}
Switch to the main
branch of this configuration:
sudo nixos-rebuild --flake github:Atry/nixos-wsl-vscode#nixosWslVsCode switch
Switch to a local work directory this configuration:
sudo nixos-rebuild --flake .#nixosWslVsCode switch
Note that this NixOS configuration also includes other optionated settings.