From 461e91a5e7025be2f91e9bfc5698cbe23943e9c6 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 12 Aug 2022 05:17:28 -0400 Subject: [PATCH] feat(devos/nix): add wherenix script --- modules/devos/nix.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/devos/nix.nix b/modules/devos/nix.nix index 80ceda6..4fd9dab 100644 --- a/modules/devos/nix.nix +++ b/modules/devos/nix.nix @@ -55,6 +55,15 @@ with lib; nixfmt nixpkgs-fmt nix-du + + (writeScriptBin "wherenix" '' + #!/usr/bin/env bash + ${unixtools.whereis}/bin/whereis "''${@}" \ + | ${gawk}/bin/awk '{ print substr($0, length($1)+2) }' \ + | ${findutils}/bin/xargs -r ${coreutils}/bin/readlink -f \ + | ${coreutils}/bin/sort \ + | ${coreutils}/bin/uniq + '') ]; shellAliases =