2024-02-28 20:05:35 +01:00
|
|
|
# Usefull commands
|
|
|
|
|
|
|
|
## Configure
|
2023-08-20 00:16:38 +02:00
|
|
|
|
|
|
|
```bash
|
|
|
|
nixos-rebuild switch --flake flake_path_directory#hostname
|
2023-08-20 00:48:31 +02:00
|
|
|
```
|
|
|
|
|
2024-02-02 22:23:20 +01:00
|
|
|
```bash
|
|
|
|
nix flake update --extra-experimental-features "nix-command flakes"
|
|
|
|
```
|
|
|
|
|
2024-03-06 23:05:20 +01:00
|
|
|
## Show changements between revisions
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nix profile diff-closures --profile /nix/var/nix/profiles/system
|
|
|
|
```
|
|
|
|
|
2024-03-06 22:59:01 +01:00
|
|
|
```bash
|
|
|
|
nix store diff-closures /nix/var/nix/profiles/system-rev1-link /nix/var/nix/profiles/system-rev2-link
|
|
|
|
```
|
|
|
|
|
2024-02-28 20:05:35 +01:00
|
|
|
## Clean system
|
2024-02-27 21:23:18 +01:00
|
|
|
|
|
|
|
List all profiles
|
|
|
|
```bash
|
|
|
|
nix profile history --profile /nix/var/nix/profiles/system
|
|
|
|
```
|
|
|
|
|
|
|
|
Remove all profiles older than 7 days
|
|
|
|
```bash
|
|
|
|
sudo nix profile wipe-history --older-than 7d --profile /nix/var/nix/profiles/system
|
|
|
|
```
|
|
|
|
|
2024-04-13 23:52:35 +02:00
|
|
|
```bash
|
|
|
|
nix profile wipe-history --older-than 7d --profile ~/.local/state/nix/profiles/home-manager
|
|
|
|
```
|
|
|
|
|
2024-02-27 21:23:18 +01:00
|
|
|
Clean up all useless store from old profiles
|
|
|
|
```bash
|
|
|
|
sudo nix store gc --debug
|
|
|
|
```
|
|
|
|
|
2024-03-10 10:36:14 +01:00
|
|
|
error: cached failure of attribute 'nixosConfigurations.perso-desktop.config.system.build.toplevel'
|
|
|
|
```bash
|
|
|
|
sudo rm -fr /root/.cache/nix/
|
|
|
|
```
|
|
|
|
|
2024-03-10 10:49:30 +01:00
|
|
|
|
2024-05-24 23:55:10 +02:00
|
|
|
## To limit resources use during build
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nixos-rebuild build-vm --cores 16 --max-jobs 1 --flake .#nixos-test
|
|
|
|
```
|
|
|
|
|
2024-10-25 11:54:57 +02:00
|
|
|
Or without NixOS
|
|
|
|
|
|
|
|
```
|
|
|
|
nix build .#nixosConfigurations.nixos-test.config.system.build.vm
|
|
|
|
```
|
|
|
|
|
2024-02-28 20:05:35 +01:00
|
|
|
# Usefull links
|
|
|
|
|
|
|
|
- https://api.github.com/rate_limit
|
|
|
|
- https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents
|
|
|
|
- https://nixpk.gs/pr-tracker.html
|
|
|
|
- https://mobile.nixos.org/
|
2024-05-24 23:46:08 +02:00
|
|
|
- https://nixos.wiki/wiki/Build_flags
|
2024-02-28 20:05:35 +01:00
|
|
|
|
2023-08-20 01:09:30 +02:00
|
|
|
# Sources
|
|
|
|
|
|
|
|
- https://github.com/ryan4yin/nix-config/tree/v0.0.2
|
|
|
|
- https://github.com/LudovicoPiero/dotfiles
|
2023-08-20 12:39:36 +02:00
|
|
|
- https://github.com/donovanglover/nix-config/
|