Merge with Coded's config

As we're working on similar things, it makes sense to make a single
config with all our stuff together. We've named our coalition "chimera"
as Coded's devices are named after cat breeds and mine are named after
bird species. We'll be using NixOS options to enable us to have
different configurations anywhere we want that

Co-Authored-By: Samuel Shuert <coded@clicks.codes>
Change-Id: Idb102526d84e76edb0bfe7153bd18dfe8566516b
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/382
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/packages/nix-provider/default.nix b/packages/nix-provider/default.nix
new file mode 100644
index 0000000..d80f296
--- /dev/null
+++ b/packages/nix-provider/default.nix
@@ -0,0 +1,2 @@
+{ writeShellScriptBin, ... }:
+writeShellScriptBin "nix-provider" (builtins.readFile ./nix-provider.sh)
diff --git a/packages/nix-provider/nix-provider.sh b/packages/nix-provider/nix-provider.sh
new file mode 100644
index 0000000..4a8bfb7
--- /dev/null
+++ b/packages/nix-provider/nix-provider.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+if [ "$1" = "" ]
+then
+  read -ep "What command are you looking for?: " CMD
+else
+  CMD=$1
+fi
+
+LOCATION=$(command -V "$CMD" 2>&1 | sed -rn "s/.* (.*)$/\1/p")
+
+if [ "$LOCATION" = "found" ] # Not found
+then
+  echo "The command $CMD wasn't found"
+  exit 1
+fi
+
+if [ "$LOCATION" = "builtin" ] # Shell builtin
+then
+  echo "The command $CMD is a shell builtin"
+  exit 0
+fi
+
+RESOLVED_LOCATION=$(readlink -f "$LOCATION")
+
+if [[ ! "$RESOLVED_LOCATION" =~ ^\/nix\/store\/.*-.*-.*$ ]];
+then
+  echo "The command $CMD is at $RESOLVED_LOCATION"
+  exit 0
+fi
+
+PACKAGE=$(echo "$RESOLVED_LOCATION" | sed -rn "s/\/nix\/store\/[^-]*-(.*)-[^-]*/\1/p")
+
+SEARCHED=$(nix search "nixpkgs#$PACKAGE" 2>&1)
+
+if [ "$SEARCHED" = "error: no results for the given search term(s)!" ]
+then
+  echo "The command $CMD is at $RESOLVED_LOCATION"
+  exit 0
+fi
+
+echo "The command $CMD is from:"
+echo "$SEARCHED"
+echo "Which is available at $RESOLVED_LOCATION"