nixos-wsl/README.md

90 lines
3.8 KiB
Markdown
Raw Permalink Normal View History

2024-09-09 22:08:49 +02:00
# NixOS WSL Flake
This is my personal, opinionated configuration of NixOS WSL when I need to use Microsoft Windows as my primary operating system. It is intended to give developers and DevOps engineers an insight into the potential of Nix. If you're interested in more Nix-related topics, you can check out my other [Projects](https://code.srx.digital/explore/repos) or follow me on [Github](https://github.com/SebastianWendel).
Dies ist meine persönliche Konfiguration von NixOS WSL, wenn ich MS Windows als mein primäres Betriebssystem verwenden muss. Sie soll mein System Konfiguration dokumentieren, reproduzierbar halten und anderen einen Einblick in das Potential von Nix geben.
Wenn du an weiteren Nix-bezogenen Themen interessiert bist, kannst du dir meine anderen [Projekte](https://code.srx.digital/explore/repos) ansehen oder mir auf [Github](https://github.com/SebastianWendel) folgen.
## 🛠️ Components
- [flake-parts](https://github.com/hercules-ci/flake-parts): Simplify Nix Flakes with the module system.
- [git-hooks](https://github.com/cachix/git-hooks.nix): Seamless integration of git hooks with Nix.
- [home-manager](https://github.com/nix-community/home-manager): Manage user environments using Nix.
- [neovim](https://github.com/nix-community/nixvim)
- [yocto](https://github.com/nix-community/nix-environments/blob/master/envs/yocto/shell.nix)
## 📁 Repository layout
```txt
├── modules - Reusable NixOS modules
├── nix - Flake-parts modules
├── default.nix - Legacy support with flake-compat
├── flake.lock - Lock file for version pinning
└── flake.nix - Flakes configuration
```
## 🚀 Getting started
### 📋 Prerequisites
#### NixOS WSL
Before proceeding, ensure you have [installed the NixOS-WSL](https://nix-community.github.io/NixOS-WSL/install.html), followed the guide and have a funtional terminal envirnment.
#### Icon Fonts
To get the necessary icons in all shell applications, install a NerdFont with additional fonts by running the following Powershell command in an administrative environment:
```powershell
& ([scriptblock]::Create((iwr 'https://to.loredo.me/Install-NerdFont.ps1')))
```
To use `Cascadia Code Nerd Font`, enter the number `11`. After completing the installation, a system restart may be required. Now you can configure `Cascadia Code NF` in your editor and terminal emulator.
Further details can be found at [Microsoft Cascadia Code](https://github.com/microsoft/cascadia-code) and
### Configure NixOS
Checkout the source tree, open you're new NixOS terminal and follw the stepps:
```sh
sudo mv /etc/nixos /etc/.nixos
sudo git clone https://gitlab.i40.ifm-datalink.net/sebastian.wendel/nixos-wls /etc/nixos
```
### Test you configuration
```sh
sudo nixos-rebuild test
```
### Apply you configuration
```sh
sudo nixos-rebuild switch
```
If something fails, you can add `--show-trace` to get a more detailed output of all the expressions on the stack.
## 🚧 Reporting issues
If you experience any issues with the infrastructure, please [post a new issue to this repository]().
## Documentation
- [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/)
- [Nix Manual](https://nix.dev/manual/nix/stable/)
- [NixOS Manual](https://nixos.org/manual/nixos/stable/)
## 📚 Links
- [Nix packages search](https://search.nixos.org/packages)
- [NixOS options search](https://search.nixos.org/options)
- [NixOS & Flakes Book](https://nixos-and-flakes.thiscute.world/)
- [NixOS Wiki](https://nixos.wiki/wiki/Main_Page)
- [Awesome Nix](https://github.com/nix-communi/awesome-nix)
## 📜 License
All files in this repository are licensed under the terms of the MIT License (MIT). Please refer to the full license text in [LICENSE](LICENSE.md).