aboutsummaryrefslogtreecommitdiffstats
path: root/home/root
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home/root/common/core/zsh/default.nix1
-rw-r--r--home/root/common/core/zsh/zshrc15
2 files changed, 16 insertions, 0 deletions
diff --git a/home/root/common/core/zsh/default.nix b/home/root/common/core/zsh/default.nix
index 8c1d93c..7829d80 100644
--- a/home/root/common/core/zsh/default.nix
+++ b/home/root/common/core/zsh/default.nix
@@ -24,6 +24,7 @@ export COLORFGBG="green;blue"
ip = "ip -c=auto";
la = "ls -aF --color=auto";
ll = "ls -alFhs --color=auto";
+ nix-list-generations = "nixos-rebuild list-generations | cat; echo; nix-env --list-generations --profile /nix/var/nix/profiles/system";
zgrep = "zgrep --color=auto";
};
};
diff --git a/home/root/common/core/zsh/zshrc b/home/root/common/core/zsh/zshrc
index 890d1f6..5338c6c 100644
--- a/home/root/common/core/zsh/zshrc
+++ b/home/root/common/core/zsh/zshrc
@@ -29,6 +29,21 @@ bindkey -M vicmd v edit-command-line
#[[ -z "$TMUX" ]] && (tmux -2 new-session -t default \; new-window || tmux -2 new-session -s default)
[[ -z "$TMUX" ]] && (tmux -2 attach -t default || tmux -2 new-session -s default)
+# Nix helper
+function nix-switch-generation {
+
+ local gen=${1}
+
+ if [[ -z "${gen}" ]]; then
+ echo 'you must specify a generation ID!' >&2
+ return 1
+ fi
+
+ nix-env --switch-generation ${gen} -p /nix/var/nix/profiles/system
+ /nix/var/nix/profiles/system/bin/switch-to-configuration switch
+
+}
+
# prompt/theme shit
function precmd {