2022-08-13 18:38:41 +00:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
psCfg = config.pub-solar;
|
|
|
|
cfg = config.pub-solar.ci-runner;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.pub-solar.ci-runner = {
|
2022-08-13 19:23:07 +00:00
|
|
|
enable = mkEnableOption "Enables a systemd service that runs drone-ci-runner";
|
2022-08-13 18:38:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-08-13 19:23:07 +00:00
|
|
|
systemd.user.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";
|
|
|
|
Restart = "always";
|
|
|
|
};
|
|
|
|
|
|
|
|
script = ''${pkgs.drone-runner-exec}'';
|
2022-08-13 18:38:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|