Nix : Add switch function.
This commit is contained in:
parent
3a389c0c75
commit
278ddca61c
|
@ -46,6 +46,18 @@ function nix_rebuild() {
|
||||||
cd -
|
cd -
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Rebuild and switch system.
|
||||||
|
# Optionally force the hostname.
|
||||||
|
# Usage: nix_switch [HOSTNAME]
|
||||||
|
function nix_switch() {
|
||||||
|
local target="${1}"
|
||||||
|
[[ "${target}" = "" ]] && target="${HOSTNAME}"
|
||||||
|
|
||||||
|
cd ${HOME}/.config/linux/system
|
||||||
|
nixos-rebuild switch --flake .#${target}
|
||||||
|
cd -
|
||||||
|
}
|
||||||
|
|
||||||
# Update system.
|
# Update system.
|
||||||
# Optionally force the hostname.
|
# Optionally force the hostname.
|
||||||
# Usage: nix_update [HOSTNAME]
|
# Usage: nix_update [HOSTNAME]
|
||||||
|
|
|
@ -270,6 +270,7 @@ Command|Description
|
||||||
`nix_unstable`|Switch to Unstable branch.
|
`nix_unstable`|Switch to Unstable branch.
|
||||||
`nix_channel`|Display current channel.
|
`nix_channel`|Display current channel.
|
||||||
`nix_rebuild [HOSTNAME]`|Rebuild system. Optionally force the hostname.
|
`nix_rebuild [HOSTNAME]`|Rebuild system. Optionally force the hostname.
|
||||||
|
`nix_switch [HOSTNAME]`|Rebuild and switch system. Optionally force the hostname.
|
||||||
`nix_update [HOSTNAME]`|Update system. Optionally force the hostname.
|
`nix_update [HOSTNAME]`|Update system. Optionally force the hostname.
|
||||||
`nix_clean`|Free up root space.
|
`nix_clean`|Free up root space.
|
||||||
`nix_shell [NAME]`|Spawn shell with specified nix environment. `Main` is default.
|
`nix_shell [NAME]`|Spawn shell with specified nix environment. `Main` is default.
|
||||||
|
|
Reference in a new issue