My NixOS development flake with configuration files for different hosts.
In order for nerd-fonts to work in WSL2 use this repo ryanoasis/nerd-fonts as a source:
and run the following command in Powershell in Windows
& ([scriptblock]::Create((iwr 'https://to.loredo.me/Install-NerdFont.ps1')))
sudo nixos-rebuild switch --flake .#wsl-x86_64 --show-trace
sudo nixos-rebuild switch --flake github:andreifloroiu/nixos-dev#wsl-x86_64sudo nixos-rebuild switch --flake .#wsl-aarch64 --show-trace
sudo nixos-rebuild switch --flake github:andreifloroiu/nixos-dev#wsl-aarch64nix flake updatePerform a cleanup from time to time:
sudo nix-collect-garbage -dsudo nixos-rebuild switch --rollbackBuild without applying configuration:
nixos-rebuild build --flake .#wsl-aarch64
nixos-rebuild build --flake .#wsl-x86_64nix build --flake .#nixosConfigurations.desktop-x86_64.config.system.build.isoImage
nix build --flake github:andreifloroiu/nixos-dev#nixosConfigurations.desktop-x86_64.config.system.build.isoImageInstall nix package manager (single-user):
sh <(curl -L https://nixos.org/nix/install) --no-daemonFollow the next instruction from install script then proceed.
Build into a result, which is a symlink:
nix build github:andreifloroiu/nixos-dev#nixosConfigurations.wsl-aarch64.config.system.build.tarballBuilder \
--extra-experimental-features nix-command --extra-experimental-features flakes \
--out-link result \
&& echo "Running result..." \
&& sudo ./result/bin/nixos-wsl-tarball-builder \
&& sudo mv nixos.wsl nixos-wsl.tar.gz \
&& sudo chown andrei:users nixos-wsl.tar.gzMove resulting file to host OS user folder:
mkdir /mnt/c/Users/{{username}}/NixOS
mv nixos-wsl.tar.gz /mnt/c/Users/{{username}}/NixOSChange to powershell on host OS and run:
cd $env:USERPROFILE\NixOS\
wsl --import NixOS $env:USERPROFILE\NixOS\ nixos-wsl.tar.gz --version 2-
Clone this repo andreifloroiu/nixos-dev.
-
cdinto it -
Build an
sd-imagefor target, e.g.nix build '.#nixosConfigurations.jump-x86_64.config.system.build.sd-image'ornix build '.#nixosConfigurations.jump-aarch64.config.system.build.sd-image'
How to get sha256:
nix flake prefetch github:google-gemini/gemini-cli/v0.15.3