aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/root/common/core/zsh/zshrc19
1 files changed, 18 insertions, 1 deletions
diff --git a/home/root/common/core/zsh/zshrc b/home/root/common/core/zsh/zshrc
index 5338c6c..a0f7fee 100644
--- a/home/root/common/core/zsh/zshrc
+++ b/home/root/common/core/zsh/zshrc
@@ -29,7 +29,7 @@ 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
+# my Nix helpers
function nix-switch-generation {
local gen=${1}
@@ -44,6 +44,23 @@ function nix-switch-generation {
}
+function nix-depends {
+
+ local pkg=${1}
+
+ if [[ -z "${pkg}" ]]; then
+ echo 'you must specify a packange name!' >&2
+ return 1
+ fi
+
+ local host=$(hostname -s)
+
+ cd /etc/nixos
+ nix why-depends .\#nixosConfigurations.${host}.config.system.build.toplevel .\#nixosConfigurations.${host}.pkgs.${pkg} --derivation | cat
+ cd ${OLDPWD}
+
+}
+
# prompt/theme shit
function precmd {