added setup script
This commit is contained in:
@@ -2,11 +2,7 @@
|
|||||||
let
|
let
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.05";
|
||||||
unstable = import <nixos-unstable> {};
|
unstable = import <nixos-unstable> {};
|
||||||
ad_src = builtins.fetchGit {
|
adPath = "/usr/src/app";
|
||||||
url = "https://gitea.john-stream.com/john/ad-nix";
|
|
||||||
ref = "main";
|
|
||||||
};
|
|
||||||
adTargetPath = "/srv/appdaemon/ad-nix";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -22,21 +18,20 @@ in
|
|||||||
(pkgs.writeShellScriptBin "nrbsu" ''
|
(pkgs.writeShellScriptBin "nrbsu" ''
|
||||||
sudo nix-channel --update && sudo nixos-rebuild switch
|
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
|
bash
|
||||||
git
|
git
|
||||||
eza
|
eza
|
||||||
# appdaemon
|
# 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;
|
virtualisation.docker.enable = true;
|
||||||
services.vscode-server.enable = true;
|
services.vscode-server.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user