diff options
author | Mark Nipper <nipsy@bitgnome.net> | 2024-06-15 13:46:36 -0700 |
---|---|---|
committer | Mark Nipper <nipsy@bitgnome.net> | 2024-06-15 13:46:36 -0700 |
commit | c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2 (patch) | |
tree | 4f98cf7f1841d16c3744c8aac6a4ccdf2cc326f3 /home/root | |
parent | fbd84b29dd191eea326ea5e6be62cce6c47dedf1 (diff) | |
download | nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.tar nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.tar.gz nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.tar.bz2 nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.tar.lz nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.tar.xz nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.tar.zst nix-c8e7cc5d04a0e7e4af3813cb8eb03e85bed1acb2.zip |
Move jq to core default package and dependency helper
Diffstat (limited to 'home/root')
-rw-r--r-- | home/root/common/core/zsh/zshrc | 19 |
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 { |