From d678c69d23451c3f66eaa8ee9748fedd9705dea4 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 10 Jan 2022 02:35:49 +0100 Subject: [PATCH] hydra: improve updater --- hosts/containers/hydra/updater.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hosts/containers/hydra/updater.nix b/hosts/containers/hydra/updater.nix index 4d746e58..ab3fe163 100644 --- a/hosts/containers/hydra/updater.nix +++ b/hosts/containers/hydra/updater.nix @@ -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 = {