hoenn: allow cli override of variable names

This commit is contained in:
Aly Raffauf 2024-05-02 19:57:29 -04:00
parent fb75cd9ec9
commit 3ecdcd5ff6

View file

@ -5,9 +5,9 @@
...
}: let
hoenn = pkgs.writeShellScriptBin "hoenn" ''
FLAKE="github:alyraffauf/nixcfg"
HOST=${config.networking.hostName}
FLAKE_SRC="https://github.com/alyraffauf/nixcfg.git"
FLAKE=''${FLAKE:-"github:alyraffauf/nixcfg"}
HOST=''${HOST:-${config.networking.hostName}}
GIT=''${GIT:-"https://github.com/alyraffauf/nixcfg.git"}
if [ "$1" = "sync" ]; then
if [ "$2" == "" ] || [ "$2" == "now" ]; then
@ -21,7 +21,7 @@
sudo ${pkgs.nix}/bin/nix-collect-garbage -d
exit 0;
elif [ "$1" == "clone" ]; then
${pkgs.git}/bin/git clone $FLAKE_SRC
${pkgs.git}/bin/git clone $GIT
cd nixcfg
exit 0;
fi