nixos/gitea: Set up Gitea Actions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
{ lib, pkgs, config, assignments, allAssignments, ... }:
|
||||
let
|
||||
inherit (lib.my.c) pubDomain;
|
||||
inherit (lib.my.c.colony) prefixes;
|
||||
@@ -72,6 +72,9 @@ in
|
||||
PASSWORD = "#mailerpass#";
|
||||
REPLY_TO_ADDRESS = "git+%{token}@nul.ie";
|
||||
};
|
||||
actions = {
|
||||
ENABLED = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -98,6 +101,12 @@ in
|
||||
ip6 saddr ${prefixes.all.v6} tcp dport 3000 accept
|
||||
}
|
||||
}
|
||||
table inet nat {
|
||||
chain prerouting {
|
||||
ip daddr ${assignments.internal.ipv4.address} tcp dport { http, https } dnat to ${allAssignments.middleman.internal.ipv4.address}
|
||||
ip6 daddr ${assignments.internal.ipv6.address} tcp dport { http, https } dnat to ${allAssignments.middleman.internal.ipv6.address}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@@ -63,6 +63,7 @@ in
|
||||
"${modulesPath}/profiles/qemu-guest.nix"
|
||||
|
||||
./valheim.nix
|
||||
./gitea-actions.nix
|
||||
];
|
||||
|
||||
config = mkMerge [
|
||||
|
62
nixos/boxes/colony/vms/whale2/gitea-actions.nix
Normal file
62
nixos/boxes/colony/vms/whale2/gitea-actions.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
inherit (builtins) toJSON;
|
||||
inherit (lib) mkForce;
|
||||
inherit (lib.my.c) pubDomain;
|
||||
|
||||
cfgFile = pkgs.writeText "gitea-actions-runner.yaml" (toJSON {
|
||||
container = {
|
||||
network = "colony";
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
config = {
|
||||
services = {
|
||||
gitea-actions-runner.instances = {
|
||||
main = {
|
||||
enable = true;
|
||||
name = "main-docker";
|
||||
labels = [ ];
|
||||
url = "https://git.${pubDomain}";
|
||||
tokenFile = config.age.secrets."gitea/actions-runner.env".path;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users = with lib.my.c.ids; {
|
||||
users = {
|
||||
gitea-runner = {
|
||||
isSystemUser = true;
|
||||
uid = uids.gitea-runner;
|
||||
group = "gitea-runner";
|
||||
home = "/var/lib/gitea-runner";
|
||||
};
|
||||
};
|
||||
groups = {
|
||||
gitea-runner.gid = gids.gitea-runner;
|
||||
};
|
||||
};
|
||||
|
||||
systemd = {
|
||||
services = {
|
||||
gitea-runner-main.serviceConfig = {
|
||||
# Needs to be able to read its secrets
|
||||
DynamicUser = mkForce false;
|
||||
User = "gitea-runner";
|
||||
Group = "gitea-runner";
|
||||
ExecStart = mkForce "${config.services.gitea-actions-runner.package}/bin/act_runner -c ${cfgFile} daemon";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
my = {
|
||||
secrets.files = {
|
||||
"gitea/actions-runner.env" = {
|
||||
owner = "gitea-runner";
|
||||
group = "gitea-runner";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@@ -439,6 +439,16 @@ in
|
||||
(mkIf config.hardware.rasdaemon.enable {
|
||||
my.tmproot.persistence.config.directories = [ "/var/lib/rasdaemon" ];
|
||||
})
|
||||
(mkIf (config.services.gitea-actions-runner.instances != { }) {
|
||||
my.tmproot.persistence.config.directories = [
|
||||
{
|
||||
directory = "/var/lib/gitea-runner";
|
||||
mode = "0750";
|
||||
user = "gitea-runner";
|
||||
group = "gitea-runner";
|
||||
}
|
||||
];
|
||||
})
|
||||
]))
|
||||
]);
|
||||
|
||||
|
Reference in New Issue
Block a user