Nix : Remove old channel before adding new one.

This commit is contained in:
Dmitry Voronin 2024-01-25 19:45:47 +03:00
parent aaa491c48d
commit 9f9e67bd5e
22 changed files with 5 additions and 2 deletions

View file

@ -20,11 +20,13 @@ function nix_find() {
# Switch to Unstable branch.
function nix_unstable() {
nix-channel --remove nixos
nix-channel --add https://nixos.org/channels/nixos-unstable nixos
}
# Switch to Small Unstable branch (for server).
function nix_unstable_small() {
nix-channel --remove nixos
nix-channel --add https://nixos.org/channels/nixos-unstable-small nixos
}
@ -35,12 +37,12 @@ function nix_channel() {
# Update system (rebuild).
function nix_update() {
nixos-rebuild switch -I nixos-config=/root/.config/linux/nix/${HOSTNAME}/Configuration.nix
nixos-rebuild switch -I nixos-config=/root/.config/linux/system/${HOSTNAME}/Configuration.nix
}
# Upgrade system.
function nix_upgrade() {
nixos-rebuild switch --upgrade -I nixos-config=/root/.config/linux/nix/${HOSTNAME}/Configuration.nix
nixos-rebuild switch --upgrade -I nixos-config=/root/.config/linux/system/${HOSTNAME}/Configuration.nix
}
# Free up root space.
@ -49,6 +51,7 @@ function nix_clean() {
[[ "${UID}" = 0 ]] && nix-store --gc
}
# Spawn shell with nix environment, like LD support.
function nix_shell() {
nix-shell ~/.config/linux/Shell.nix
}