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