feat(nasp): enable registry

This commit is contained in:
Dict Xiong 2024-05-29 20:44:43 +08:00
parent 619b0c998e
commit 4dc50acbe8
2 changed files with 27 additions and 0 deletions

View File

@ -143,6 +143,21 @@ in
];
programs.zsh.enable = true;
services.cron.enable = true;
systemd.timers."registry" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "*:0/5:0";
Unit = "registry.service";
};
};
systemd.services."registry" = {
serviceConfig = {
Type = "oneshot";
User = "root";
};
script = builtins.readFile ./scripts/registry.sh;
path = [ pkgs.git pkgs.bash pkgs.su ];
};
## user config
users.users.root.shell = pkgs.zsh;
## dotfiles.cn

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -ex
if [[ ! -e /opt/registry/scripts/testbed_cron.sh ]]; then
mkdir -p /opt
cd /opt
git clone https://git.nasp.fit/NASP/registry.git
fi
cd /opt/registry
git pull
bash /opt/registry/scripts/testbed_cron.sh