Changes
1 changed files (+4/-2)
-
-
@@ -10,13 +10,15 @@ Prefer the new `nix` CLI when possible instead of the old `nix-*` commands. It's| --- | --- | | Run program | `nix run nixpkgs#hello` (needs `--` if passing args) | | Run AppImage | `appimage-run blah.AppImage` | | Clean Nix store | `run0 nix-collect-garbage && nix store optimise` | | Get size of system | `nix path-info -Sh /nix/var/nix/profiles/system` | | Get size of Nix store | `sqlite3 /nix/var/nix/db/db.sqlite 'SELECT SUM(narSize) FROM ValidPaths'` | | Get largest packages | `sqlite3 /nix/var/nix/db/db.sqlite 'SELECT * FROM ValidPaths ORDER BY narSize DESC LIMIT 50'` | | Check if anything depends on path | `nix-store --query --referrers /nix/store/blah` | | Clean Nix store | `run0 nix-collect-garbage && nix store optimise` | | Check what depends on path | `nix-store --query --referrers /nix/store/blah` | | List system generations | `nixos-rebuild list-generations` | | Switch to generation | `run0 fish -c "cd /nix/var/nix/profiles && nix-env --switch-generation 314 -p /nix/var/nix/profiles/system && system/bin/switch-to-configuration switch"` | | Get changes between system generations | `nix profile diff-closures --profile /nix/var/nix/profiles/system` | | Deploy to current machine | `nixos-rebuild switch --sudo` | | Deploy to remote machine | `NIX_SSHOPTS="-i ~/.ssh/nixos-rebuild" nixos-rebuild switch --flake .#Unnamed-Server --target-host root@unnamed.website` | | Build VM from config | `nixos-rebuild build-vm && result/bin/run-* -m 4G -smp 8 -device virtio-vga-gl -display sdl,gl=on` (may need to change the QEMU version in the run script if the config uses a different nixpkgs) | | Install specific version of package | https://lazamar.co.uk/nix-versions/ |
-