dotfiles/nixos/boxes/bolty/gitea-runner.nix

54 lines
1.4 KiB
Nix
Raw Normal View History

2023-08-13 17:00:41 +01:00
{
config,
pkgs,
inputs,
lib,
system,
...
}: let
2023-07-23 08:31:31 +01:00
unstable = inputs.nixpkgs-nixos-unstable;
package = unstable.legacyPackages."${system}".gitea-actions-runner;
2023-08-13 17:00:41 +01:00
in {
2023-06-01 22:10:18 +01:00
sops.secrets."gitea-runner-token" = {
sopsFile = ./gitea-runner-token.sops;
format = "binary";
};
2023-08-12 14:43:42 +01:00
virtualisation.docker = {
2023-06-01 22:10:18 +01:00
enable = true;
autoPrune.enable = true;
2023-08-13 17:00:41 +01:00
daemon.settings = {
2023-08-12 10:13:28 +01:00
};
2023-06-01 22:10:18 +01:00
};
2023-08-13 17:00:41 +01:00
disabledModules = ["services/continuous-integration/gitea-actions-runner.nix"];
imports = ["${unstable}/nixos/modules/services/continuous-integration/gitea-actions-runner.nix"];
2023-07-23 09:53:27 +01:00
2023-07-23 08:31:31 +01:00
services.gitea-actions-runner = {
inherit package;
instances.boltyone = {
2023-07-23 08:31:31 +01:00
enable = true;
url = "https://git.cyplo.dev";
tokenFile = config.sops.secrets."gitea-runner-token".path;
name = "bolty one";
2023-07-23 10:14:37 +01:00
hostPackages = with pkgs; [
bash
coreutils
curl
gawk
gitMinimal
gnused
nodejs
wget
sudo
2023-07-30 22:01:55 +01:00
nix
2023-07-23 10:14:37 +01:00
];
2023-07-23 08:31:31 +01:00
labels = [
"flakes-action:docker://git.cyplo.dev/cyplo/base-images/flakes-action:latest"
"ubuntu-kinetic:docker://ubuntu:kinetic"
2023-07-23 10:06:40 +01:00
"linux_amd64:host" # compat with github actions
2023-07-23 08:31:31 +01:00
];
};
2023-06-01 22:10:18 +01:00
};
2023-08-12 14:47:37 +01:00
environment.etc."gitea-actions-runner/config".text = builtins.readFile ./gitea-runner-config;
2023-08-12 14:43:42 +01:00
systemd.services.gitea-runner-bolty1.serviceConfig.ExecStart = lib.mkForce "${package}/bin/act_runner -c /etc/gitea-actions-runner/config daemon";
2023-06-01 22:10:18 +01:00
}