Fix CI runner, get secrets from file

This commit is contained in:
Benjamin Bädorf 2022-08-13 22:03:08 +02:00
parent f4eb615954
commit 7542014d33
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, self, ... }:
with lib;
let
psCfg = config.pub-solar;
@ -10,18 +10,26 @@ in
};
config = mkIf cfg.enable {
systemd.user.services.ci-runner = {
systemd.services.ci-runner = {
enable = true;
description = "CI runner for the PubSolarOS repository that can run test VM instances with KVM.";
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
Type = "simple";
Restart = "always";
};
script = ''${pkgs.drone-runner-exec}'';
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "libvirtd.service" ];
script = ''${pkgs.drone-runner-exec}/bin/drone-runner-exec daemon /run/agenix/drone-runner-exec-config'';
};
age.secrets."drone-runner-exec-config" = {
file = "${self}/secrets/drone-runner-exec-config";
mode = "700";
owner = "root";
};
};
}