Merge branch 'feature/ci-runner-onecommit' into feature/ci-runner-onecommit-test
This commit is contained in:
commit
4f881ee6a5
35
modules/ci-runner/default.nix
Normal file
35
modules/ci-runner/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ lib, config, pkgs, self, ... }:
|
||||||
|
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.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";
|
||||||
|
};
|
||||||
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue