Nix : Remove old channel before adding new one.
This commit is contained in:
parent
aaa491c48d
commit
9f9e67bd5e
|
@ -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
|
||||
}
|
||||
|
|
Reference in a new issue