added setup script

This commit is contained in:
John Lancaster
2024-09-14 00:57:28 +00:00
parent 1e6cda5edb
commit 61b130f52e

View File

@@ -2,11 +2,7 @@
let
stateVersion = "24.05";
unstable = import <nixos-unstable> {};
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;