notiz:nixos-cheats
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| notiz:nixos-cheats [2021/01/09 15:04] – clerie | notiz:nixos-cheats [2022/10/15 13:33] (aktuell) – clerie | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== NixOS cheats ====== | ====== NixOS cheats ====== | ||
| + | |||
| + | ===== Nix Flakes ===== | ||
| + | |||
| + | ==== Nix Build Host Configuration ==== | ||
| + | |||
| + | <code bash> | ||
| + | nix build .# | ||
| + | </ | ||
| + | |||
| + | ==== Neuen NixOS Host von Flake installieren ==== | ||
| + | |||
| + | <code bash> | ||
| + | sudo nixos-install --no-root-passwd --root /mnt --flake git+https:// | ||
| + | </ | ||
| + | |||
| ===== Konfiguration mit eigenen Paketquellen für eine VM bauen ===== | ===== Konfiguration mit eigenen Paketquellen für eine VM bauen ===== | ||
| Zeile 6: | Zeile 21: | ||
| </ | </ | ||
| - | ===== SD-Karen Image bauen ===== | + | ===== SD-Karten |
| <code bash> | <code bash> | ||
| nix build -f "< | nix build -f "< | ||
| </ | </ | ||
| + | |||
| + | ===== NixOS in Xen ===== | ||
| + | |||
| + | < | ||
| + | imports = [ | ||
| + | (modulesPath + "/ | ||
| + | ]; | ||
| + | </ | ||
| + | |||
| + | ===== NixOS hardware-configuration.nix ===== | ||
| + | |||
| + | <code bash> | ||
| + | sudo nixos-generate-config --show-hardware-config | ||
| + | </ | ||
| + | |||
| + | ===== Deklaration einer Option finden ===== | ||
| + | <code bash> | ||
| + | sudo nixos-option system.build | ||
| + | </ | ||
| + | |||
| + | ===== Paket bauen ===== | ||
| + | <code bash> | ||
| + | nix-build -E "with import < | ||
| + | </ | ||
| + | |||
| + | ===== Channel updates ===== | ||
| + | <code bash> | ||
| + | nix-channel --update nixos | ||
| + | </ | ||
| + | |||
| + | ===== Nix Store aufräumen / Alte Generationen entfernen ===== | ||
| + | |||
| + | Im Normalfall reicht das hier: | ||
| + | <code bash> | ||
| + | sudo reboot | ||
| + | sudo nix-collect-garbage -d | ||
| + | </ | ||
| + | |||
| + | Alle Generationen die älter als 14 Tage sind entfernen: | ||
| + | <code bash> | ||
| + | sudo nix-env --delete-generations 14d | ||
| + | </ | ||
| + | |||
| + | Ungenutze Pakete entfernen: | ||
| + | <code bash> | ||
| + | sudo nix-store --gc | ||
| + | </ | ||
| + | |||
notiz/nixos-cheats.1610201040.txt.gz · Zuletzt geändert: von clerie
