Turn it into a flake
Move your system into a flake
The machine you installed last time is still here, still called snowflake. Its description lives in /etc/nixos, where root owns it and nothing pins the version of nixpkgs it was built from. We'll move it into a folder of your own, and archive the originals only after the flake has really built the system.
This folder is empty.
Turn on the two experimental features a flake needs.
- Set
nix.settings.experimental-featuresto[ "nix-command" "flakes" ]
Make this flake describe snowflake instead of building hello.
- Point
inputs.nixpkgs.urlat a nixpkgs branch - Build
nixosConfigurations.snowflakewithnixpkgs.lib.nixosSystem - List
./configuration.nixinmodules
Read onlyNixOS generated this file. Change it and the next rebuild writes it back.
- OS Name
- NixOS 26.05 (Yarara)
- Kernel Version
- Linux 6.12.41
- Windowing System
- Wayland
- Processor
- Virtual CPU × 4
- Memory
- 4.0 GiB
- Disk Capacity
- 64.0 GB
- System Generation
- 1
Everything on this page is decided by /etc/nixos/configuration.nix.
NixOS
Declarative builds and deployments.
Firefox is here because your configuration says programs.firefox.enable = true; - not because anyone installed it.
Every generation you have built is still here.
Use the ↑ and ↓ keys to choose one, then press enter to boot it.
Your machine is a flake
snowflake is built from ~/nixos-config, with the old files safe in /etc/nixos/archive. The version of nixpkgs it used is written down in flake.lock, so the same folder can reproduce the same system on a compatible machine.
Share your thoughts