From 61b130f52e8cea8f9c0da1ae4c56da46255d1c7f Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sat, 14 Sep 2024 00:57:28 +0000 Subject: [PATCH] added setup script --- configuration.nix | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/configuration.nix b/configuration.nix index 184ca76..46fd020 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,11 +2,7 @@ let stateVersion = "24.05"; unstable = import {}; - ad_src = builtins.fetchGit { - url = "https://gitea.john-stream.com/john/ad-nix"; - ref = "main"; - }; - adTargetPath = "/srv/appdaemon/ad-nix"; + adPath = "/usr/src/app"; in { imports = [ @@ -22,21 +18,20 @@ in (pkgs.writeShellScriptBin "nrbsu" '' sudo nix-channel --update && sudo nixos-rebuild switch '') + (pkgs.writeShellScriptBin "setup" '' + if [ ! -d ${adPath} ]; then + sudo git clone https://gitea.john-stream.com/john/ad-nix ${adPath} + sudo chown -R appdaemon:users ${adPath} + else + echo "${adPath} already exists" + fi + '') bash git eza # appdaemon ]; - system.userActivationScripts.ad-setup.text = '' - if [ ! -d ${adTargetPath} ]; then - ${pkgs.git}/bin/git clone https://gitea.john-stream.com/john/ad-nix ${adTargetPath} - chown -R appdaemon:users ${adTargetPath} - else - ${pkgs.git}/bin/git -C ${adTargetPath} pull - fi - ''; - virtualisation.docker.enable = true; services.vscode-server.enable = true; services.openssh.enable = true;