system-flakes — NixOS-WSL/Home Manger configuration
This project is based on the flake-parts' ez-configs module, with binary caching supported by Cachix.
To push a specific version of the flake inputs to the cache, run this command on the root of a local checkout of this repository:
flake-archive | cachix-cache pushShow the outpus provided by a flake.
Variants:
nix flake show . --no-pure-evalnix flake show 'github:nix-community/NixOS-WSL'nix flake show 'github:karaolidis/NixOS-WSL/wl-clipboard-wsl'nix flake show 'github:nixos/nixpkgs/nixpkgs-unstable'
Run a Nix application.
Variants:
nix run 'github:nixos/nixpkgs/nixpkgs-unstable#jq'
Variants:
nix run 'github:nixos/nixpkgs/nixpkgs-unstable#jq'GALLIUM_DRIVER=d3d12 MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA glxinfo -B | grep "OpenGL renderer"
Variants:
vulkaninfo --summary
nix-collect-garbage --delete-old 2>&1 | tail -n 10deleting '/nix/store/7idn96xls9kg5q86s7jlx15jm4qank0p-source.drv'
deleting '/nix/store/41d462rhm7akbbsyas4ijrivviqzkp09-source.drv'
deleting '/nix/store/gwv35hlkzsjj32d0npc2jmcyav9nnffk-crate-log-0.4.27.tar.gz.drv'
deleting '/nix/store/b30d9zi2pyvj509n98mzrc7kz8p8km3r-X11-1.10.3.tar.gz.drv'
deleting '/nix/store/z25irbb8f4gv5l4i6qq5wjqz3872p852-source'
deleting '/nix/store/cfs3gfwcgfh3vp2rmdaj8zncy6d3x2if-source.drv'
deleting '/nix/store/4g32afb2x1sbmvbj12br9cklq8myk5k2-matplotlib-3.11.1.tar.gz.drv'
deleting unused links...
note: hard linking is currently saving 10.6 GiB
3241 store paths deleted, 7.0 GiB freed
sudo nix-collect-garbage --delete-old 2>&1 | tail -n 10deleting '/nix/store/yg3icqd3z8m265if98l7k1ambic0s3an-source.drv'
deleting '/nix/store/1x94g35y9hxxa0ipj3v96rn0cbid7xbn-system-units'
deleting '/nix/store/9k6mwi35mscxbvikhk9zh368hcfs16ra-unit-dbus-broker.service'
deleting '/nix/store/wwwrp13k5qyslijpcy0nicqi5ss4c245-X-Restart-Triggers-dbus-broker'
deleting '/nix/store/jxanxfdxhwsr3id84jh2iazj3rc49dd3-dbus-1'
deleting '/nix/store/5lg18qv7bgrpsr8dy7lgcp1z14rcprry-system-path'
deleting '/nix/store/np442w66n363ydl8xp92lzkmdj5bih4a-codex-0.160.0'
deleting unused links...
note: hard linking is currently saving 10.6 GiB
24 store paths deleted, 555.0 MiB freed
Calls the flake default formatter.
Warning
This will run commands embedded in markdown.
After a successful and non-idempotent just switch, it may make sense to free up disk space by running nix-collect-garbage. Formatting the README.md file is an unusual way to accomplish this:
touch README.md
nix fmtBe sure to know the name of your WSL distribution:
wsl --list -v NAME STATE VERSION
* NixOS Running 2
podman-machine-default Stopped 2
docker-desktop Stopped 2
It must not be sparsed already:
wsl --manage NixOS --set-sparse falseLearn the path of its VHDX file:
Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss\*"State : 1
Version : 2
BasePath : C:\Users\tarci\AppData\Local\wsl\{7527fb51-83d7-4564-bc19-617c2e6b096a}
Flags : 15
DefaultUid : 0
RunOOBE : 0
VhdFileName : ext4.vhdx
DistributionName : NixOS
Modern : 1
ShortcutPath : C:\Users\tarci\AppData\Roaming\Microsoft\Windows\Start Menu\NixOS.lnk
TerminalProfilePath : C:\Users\tarci\AppData\Local\Microsoft\Windows Terminal\Fragments\Microsoft.WSL\{96dc692a-1006-5fa5-bc6b-f63e8df2226b}.json
Flavor : nixos
OsVersion : 26.11
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{7527fb51-83d7-4564-bc19-617c2e6b096a}
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
PSChildName : {7527fb51-83d7-4564-bc19-617c2e6b096a}
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry
Optimize the disk:
optimize-vhd -Path 'C:\Users\tarci\AppData\Local\wsl\{7527fb51-83d7-4564-bc19-617c2e6b096a}\ext4.vhdx' -Mode full(Re)Enable sparse mode:
wsl --manage NixOS --set-sparse true --allow-unsafeez-configs's author own dotfiles: ehllie/dotfiles
home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
size = 28;
};Verify:
env | grep -i cursorExpected:
XCURSOR_PATH=/home/tarci/.nix-profile/share/icons:/home/tarci/.icons:/home/tarci/.local/share/icons:/home/tarci/.nix-profile/share/icons:/home/tarci/.nix-profile/share/pixmaps:/nix/profile/share/icons:/nix/profile/share/pixmaps:/home/tarci/.local/state/nix/profile/share/icons:/home/tarci/.local/state/nix/profile/share/pixmaps:/etc/profiles/per-user/tarci/share/icons:/etc/profiles/per-user/tarci/share/pixmaps:/nix/var/nix/profiles/default/share/icons:/nix/var/nix/profiles/default/share/pixmaps:/run/current-system/sw/share/icons:/run/current-system/sw/share/pixmaps
XCURSOR_SIZE=28
XCURSOR_THEME=Vanilla-DMZ