{"id":23739368,"url":"https://github.com/LGUG2Z/nixos-wsl-starter","last_synced_at":"2025-09-04T14:33:13.389Z","repository":{"id":197082580,"uuid":"697957367","full_name":"LGUG2Z/nixos-wsl-starter","owner":"LGUG2Z","description":"A sane, batteries-included starter template for running NixOS on WSL","archived":false,"fork":false,"pushed_at":"2024-12-15T21:30:07.000Z","size":32,"stargazers_count":265,"open_issues_count":3,"forks_count":84,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-24T21:04:47.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LGUG2Z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-28T20:35:34.000Z","updated_at":"2024-12-24T20:33:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c081d1fd-1db1-4368-89bd-e5f1559a7927","html_url":"https://github.com/LGUG2Z/nixos-wsl-starter","commit_stats":null,"previous_names":["lgug2z/nixos-wsl-starter"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGUG2Z%2Fnixos-wsl-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGUG2Z%2Fnixos-wsl-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGUG2Z%2Fnixos-wsl-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LGUG2Z%2Fnixos-wsl-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LGUG2Z","download_url":"https://codeload.github.com/LGUG2Z/nixos-wsl-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231970924,"owners_count":18453924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T09:36:49.335Z","updated_at":"2024-12-31T09:37:37.777Z","avatar_url":"https://github.com/LGUG2Z.png","language":"Nix","funding_links":["https://github.com/sponsors/LGUG2Z"],"categories":["Nix"],"sub_categories":[],"readme":"# nixos-wsl-starter\n\nThis repository is intended to be a sane, batteries-included starter template\nfor running a [JeezyVim](https://github.com/LGUG2Z/JeezyVim)-powered NixOS\ndevelopment environment on WSL.\n\nIf you don't want to dig into NixOS too much right now, the only file you need\nto concern yourself with is [home.nix](home.nix). This is where you can add and\nremove binaries to your global `$PATH`.\n\nGo to [https://search.nixos.org](https://search.nixos.org/packages) to find the\ncorrect package names, though usually they will be what you expect them to be\nin other package managers.\n\n`unstable-packages` is for packages that you want to always keep at the latest\nreleased versions, and `stable-packages` is for packages that you want to track\nwith the current release of NixOS (currently 24.05).\n\nIf you want to update the versions of the available `unstable-packages`, run\n`nix flake update` to pull the latest version of the Nixpkgs repository and\nthen apply the changes.\n\nMake sure to look at all the `FIXME` notices in the various files which are\nintended to direct you to places where you may want to make configuration\ntweaks.\n\nIf you found this starter template useful, please consider\n[sponsoring](https://github.com/sponsors/LGUG2Z) and [subscribing to my YouTube\nchannel](https://www.youtube.com/channel/UCeai3-do-9O4MNy9_xjO6mg?sub_confirmation=1).\n\n## What Is Included\n\nThis starter is a lightly-opinionated take on a productive terminal-driven\ndevelopment environment based on my own preferences. However, it is trivial to\ncustomize to your liking both by removing and adding tools that you prefer.\n\n- The default editor is [JeezyVim](https://github.com/LGUG2Z/JeezyVim)\n- `win32yank` is used to ensure perfect bi-directional copying and pasting to\n  and from Windows GUI applications and LunarVim running in WSL\n- The default shell is `fish`\n- Native `docker` (ie. Linux, not Windows) is enabled by default\n- The prompt is [Starship](https://starship.rs/)\n- [`fzf`](https://github.com/junegunn/fzf),\n  [`lsd`](https://github.com/lsd-rs/lsd),\n  [`zoxide`](https://github.com/ajeetdsouza/zoxide), and\n  [`broot`](https://github.com/Canop/broot) are integrated into `fish` by\n  default\n  - These can all be disabled easily by setting `enable = false` in\n    [home.nix](home.nix), or just removing the lines all together\n- [`direnv`](https://github.com/direnv/direnv) is integrated into `fish` by\n  default\n- `git` config is generated in [home.nix](home.nix) with options provided to\n  enable private HTTPS clones with secret tokens\n- `fish` config is generated in [home.nix](home.nix) and includes git aliases,\n  useful WSL aliases\n\n### win32yank\n\nThere have been some recent changes in WSL2 that make running `win32yank`\nwithin WSL2 very slow. You should install this on Windows by running `scoop\ninstall win32yank` or compiling it from source, and then adding it to your `$PATH`:\n\n```nix\n{\n    programs.fish = {\n      interactiveShellInit = ''\n        fish_add_path --append /mnt/c/Users/\u003cYour Windows Username\u003e/scoop/apps/win32yank/0.1.1\n      '';\n    };\n}\n```\n\n## Quickstart\n\n[![Watch the walkthrough video](https://img.youtube.com/vi/ZuVQds2hncs/hqdefault.jpg)](https://www.youtube.com/watch?v=ZuVQds2hncs)\n\n- Get the [latest\n  release](https://github.com/LGUG2Z/nixos-wsl-starter/releases)\n- Install it (tweak the command to your desired paths):\n\n```powershell\nwsl --import NixOS .\\NixOS\\ .\\nixos-wsl.tar.gz --version 2\n```\n\n- Enter the distro:\n\n```powershell\nwsl -d NixOS\n```\n\n- Get a copy of this repo (you'll probably want to fork it eventually):\n\n```bash\ngit clone https://github.com/LGUG2Z/nixos-wsl-starter.git /tmp/configuration\ncd /tmp/configuration\n```\n\n- Change the username to your desired username in `flake.nix` with `nvim` (or\n  whichever editor you prefer)\n- Install `win32yank` with `scoop` and add it to your `$PATH` in NixOS\n- Apply the configuration and shutdown the WSL2 VM\n\n```bash\nsudo nixos-rebuild switch --flake /tmp/configuration \u0026\u0026 sudo shutdown -h now\n```\n\n- Reconnect to the WSL2 VM\n\n```bash\nwsl -d NixOS\n```\n\n- `cd ~` and then `pwd` should now show `/home/\u003cYOUR_USERNAME\u003e`\n- Move the configuration to your new home directory\n\n```bash\nmv /tmp/configuration ~/configuration\n```\n\n- Go through all the `FIXME:` notices in `~/configuration` and make changes\n  wherever you want\n- Apply the configuration\n\n```bash\nsudo nixos-rebuild switch --flake ~/configuration\n```\n\nNote: If developing in Rust, you'll still be managing your toolchains and\ncomponents like `rust-analyzer` with `rustup`!\n\n## Project Layout\n\nIn order to keep the template as approachable as possible for new NixOS users,\nthis project uses a flat layout without any nesting or modularization.\n\n- `flake.nix` is where dependencies are specified\n  - `nixpkgs` is the current release of NixOS\n  - `nixpkgs-unstable` is the current trunk branch of NixOS (ie. all the\n    latest packages)\n  - `home-manager` is used to manage everything related to your home\n    directory (dotfiles etc.)\n  - `nur` is the community-maintained [Nix User\n    Repositories](https://nur.nix-community.org/) for packages that may not\n    be available in the NixOS repository\n  - `nixos-wsl` exposes important WSL-specific configuration options\n  - `nix-index-database` tells you how to install a package when you run a\n    command which requires a binary not in the `$PATH`\n- `wsl.nix` is where the VM is configured\n  - The hostname is set here\n  - The default shell is set here\n  - User groups are set here\n  - WSL configuration options are set here\n  - NixOS options are set here\n- `home.nix` is where packages, dotfiles, terminal tools, environment variables\n  and aliases are configured\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLGUG2Z%2Fnixos-wsl-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLGUG2Z%2Fnixos-wsl-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLGUG2Z%2Fnixos-wsl-starter/lists"}