Changes
2 changed files (+3/-25)
-
-
@@ -4,28 +4,4 @@ My NixOS configuration files for my laptop and the server running this site.I generally try to keep these configs simple and pragmatic, so stuff like Home Manager, Firefox extensions, and other 3rd-party flakes are out-of-scope. Besides, I don't want to write hundreds of lines of Nix and spend all day Nixifying my entire setup. This repo is for machine-specific stuff. For my machine-independent configs, see [my dotfiles repo](/dotfiles). Another reason for this separation is so that I can just clone my dotfiles anywhere, not just on NixOS machines. ## Cheatsheet Prefer the new `nix` CLI when possible instead of the old `nix-*` commands. It's way better. | Task | Command | | --- | --- | | Run program | `nix run nixpkgs#hello` (needs `--` if passing args) | | Run AppImage | `appimage-run blah.AppImage` | | 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'` | | 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 "nix-env --switch-generation 1234 -p /nix/var/nix/profiles/system && /nix/var/nix/profiles/system/bin/switch-to-configuration switch"` | | Get changes between system generations | `nix profile diff-closures --profile /nix/var/nix/profiles/system` | | Build and deploy to current machine | `nixos-rebuild switch --sudo` | | Build on remote machine and deploy to current machine | `run0 env SSH_AUTH_SOCK=$SSH_AUTH_SOCK nixos-rebuild switch --build-host sipb@boss-baby --use-substitutes` (needs root to add untrusted paths to the Nix store) | | Build on current machine and 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 all occurrences of the QEMU version in the run script if the config uses a different nixpkgs) | | Build ISO from config | Add `"/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"` as a module, then run `nix build .#nixosConfigurations.$hostname.config.system.build.isoImage` (may need to comment out some stuff) | | Install specific version of package | https://lazamar.co.uk/nix-versions/ | | Run Nix file | `nix eval -f main.nix` | | Inspect system config in REPL | `nix repl .#nixosConfigurations.$hostname` | | Fix uv `libstdc++.so.6` error | `LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH uv run` | I also made a [NixOS cheatsheet](https://forgejo.mit.edu/SIPB/nixos-cheatsheet/).
-
-
-
@@ -23,7 +23,9 @@use-xdg-base-directories = true; # Fancy stuff yay experimental-features = [ # The new CLI is so much nicer "nix-command" # Still have no idea what a "flake" is "flakes" # Leanify Nix "pipe-operators"
-