nixos/README.md
Florian RICHER dafb3dbb1c
All checks were successful
check / check (push) Successful in 42s
Add build vm without nixos
2024-10-25 11:54:57 +02:00

1.6 KiB

Usefull commands

Configure

nixos-rebuild switch --flake flake_path_directory#hostname
nix flake update --extra-experimental-features "nix-command flakes"

Show changements between revisions

nix profile diff-closures --profile /nix/var/nix/profiles/system
nix store diff-closures /nix/var/nix/profiles/system-rev1-link /nix/var/nix/profiles/system-rev2-link

Clean system

List all profiles

nix profile history --profile /nix/var/nix/profiles/system

Remove all profiles older than 7 days

sudo nix profile wipe-history --older-than 7d --profile /nix/var/nix/profiles/system
nix profile wipe-history --older-than 7d --profile ~/.local/state/nix/profiles/home-manager

Clean up all useless store from old profiles

sudo nix store gc --debug

error: cached failure of attribute 'nixosConfigurations.perso-desktop.config.system.build.toplevel'

sudo rm -fr /root/.cache/nix/

To limit resources use during build

nixos-rebuild build-vm --cores 16 --max-jobs 1 --flake .#nixos-test

Or without NixOS

nix build .#nixosConfigurations.nixos-test.config.system.build.vm

Usefull links

Sources