From 03e40b7f145b21a3ed247fa2fbcd859fa29c7458 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sat, 14 Sep 2024 01:05:07 +0000 Subject: [PATCH] changed cloning --- configuration.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 2e957d5..0302114 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,9 @@ let stateVersion = "24.05"; unstable = import {}; + adNixPath = "/srv/appdaemon/ad-nix"; adPath = "/usr/src/app"; + adBranch = "hass"; in { imports = [ @@ -19,8 +21,15 @@ in sudo nix-channel --update && sudo nixos-rebuild switch '') (pkgs.writeShellScriptBin "ad-clone" '' + if [ ! -d ${adNixPath} ]; then + sudo git clone https://gitea.john-stream.com/john/ad-nix ${adNixPath} + sudo chown -R appdaemon:users ${adNixPath} + else + echo "${adNixPath} already exists" + fi + if [ ! -d ${adPath} ]; then - sudo git clone https://gitea.john-stream.com/john/ad-nix ${adPath} + sudo git clone -b ${adBranch} https://github.com/jsl12/appdaemon ${adPath} sudo chown -R appdaemon:users ${adPath} else echo "${adPath} already exists"