1
0
Fork 0

Added how to upgrade channel

This commit is contained in:
Jan Grosser 2024-06-02 21:07:14 +02:00
parent 8c597eaed4
commit 6c719546c8

View file

@ -7,11 +7,7 @@ My NixOS configuration repository
2. Reboot into NixOS 2. Reboot into NixOS
3. Edit `/etc/nixos/configuration.nix` with sudoedit 3. Edit `/etc/nixos/configuration.nix` with sudoedit
- Change hostname - Change hostname
- Enable flakes. Add the following lines: - Enable flakes by adding the line `nix.settings.experimental-features = [ "nix-command" "flakes" ];`
```
# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
```
- Install tmux, neovim, git by adding them to `environment.systemPackages = with pkgs; [` - Install tmux, neovim, git by adding them to `environment.systemPackages = with pkgs; [`
4. Apply changes: `sudo nixos-rebuild switch` and reboot 4. Apply changes: `sudo nixos-rebuild switch` and reboot
5. Clone NixOS config repository to /home/$USER/nixos: 5. Clone NixOS config repository to /home/$USER/nixos:
@ -37,6 +33,17 @@ Then, perform nixos rebuild:
sudo nixos-rebuild switch --flake ~/nixos/#<host> sudo nixos-rebuild switch --flake ~/nixos/#<host>
``` ```
## Upgrading to a new NixOS channel
List the current channels:
```
sudo nix-channel --list
```
Change the channel `nixos`:
```
sudo nix-channel --add https://nixos.org/channels/nixos-<rel>
```
Then, perform an update like above.
## Garbage Collection ## Garbage Collection
List all generations: List all generations:
``` ```