os/modules/ci-runner/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1,003 B
Nix
Raw Normal View History

{
lib,
config,
pkgs,
2023-11-11 00:05:42 +00:00
flake,
...
}:
with lib; let
psCfg = config.pub-solar;
cfg = config.pub-solar.ci-runner;
in {
options.pub-solar.ci-runner = {
enable = mkEnableOption "Enables a systemd service that runs drone-ci-runner";
};
config = mkIf cfg.enable {
systemd.user.services.ci-runner = {
enable = true;
description = "CI runner for the PubSolarOS repository that can run test VM instances with KVM.";
serviceConfig = {
Type = "simple";
Restart = "always";
};
2022-08-14 18:24:50 +00:00
path = [
pkgs.git
pkgs.nix
2022-08-25 13:25:34 +00:00
pkgs.libvirt
2022-08-14 18:24:50 +00:00
];
wantedBy = ["multi-user.target"];
2022-08-25 13:25:34 +00:00
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" = {
2023-11-11 00:05:42 +00:00
file = "${flake.self}/secrets/drone-runner-exec-config";
mode = "700";
owner = psCfg.user.name;
};
};
}