From c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Sat, 15 Jun 2024 13:46:36 -0700 Subject: Move jq to core default package and dependency helper --- home/root/common/core/zsh/zshrc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'home') 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 { -- cgit v1.2.3