hydra: improve updater
This commit is contained in:
parent
f6ea1f0332
commit
d678c69d23
|
@ -13,23 +13,22 @@
|
|||
"d ${config.users.users.updater.home} 0700 updater ${config.users.users.updater.group} -"
|
||||
];
|
||||
|
||||
# Build script
|
||||
# Timer-triggered service that updates flake.lock and pushes to a
|
||||
# branch to be picked up by Hydra.
|
||||
systemd.services.updater = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = with pkgs; [ git nixFlakes curl ];
|
||||
script = ''
|
||||
git config --global user.email "astro@spaceboyz.net"
|
||||
git config --global user.name "Astrobot"
|
||||
|
||||
TEMP=$(mktemp -d)
|
||||
cd $TEMP
|
||||
|
||||
git clone --depth=1 --single-branch gitea@gitea.c3d2.de:C3D2/nix-config.git
|
||||
cd nix-config
|
||||
nix flake update
|
||||
nix flake update --commit-lock-file
|
||||
|
||||
git config user.email "astro@spaceboyz.net"
|
||||
git config user.name "Astrobot"
|
||||
|
||||
git add flake.lock
|
||||
git commit -m "flake.lock: update"
|
||||
git push -f origin HEAD:flake-update
|
||||
'';
|
||||
serviceConfig = {
|
||||
|
|
Loading…
Reference in New Issue