54 lines
1.5 KiB
Nix
54 lines
1.5 KiB
Nix
|
# Forgejo
|
||
|
{ config, pkgs, lib, ... }:
|
||
|
|
||
|
let
|
||
|
inherit (lib) mkOption mkDefault;
|
||
|
in
|
||
|
{
|
||
|
options = {
|
||
|
nixin.forge-runner = {
|
||
|
token-file = mkOption { type = lib.types.str; };
|
||
|
#token = mkOption { type = lib.types.str; };
|
||
|
url = mkOption { type = lib.types.str; };
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = {
|
||
|
virtualisation.containers.enable = true;
|
||
|
virtualisation.podman = {
|
||
|
enable = true;
|
||
|
|
||
|
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
||
|
#dockerCompat = true;
|
||
|
|
||
|
# Required for containers under podman-compose to be able to talk to each other.
|
||
|
defaultNetwork.settings.dns_enabled = true;
|
||
|
};
|
||
|
|
||
|
services.gitea-actions-runner = {
|
||
|
package = pkgs.forgejo-runner;
|
||
|
instances.default = {
|
||
|
enable = true;
|
||
|
name = "local-runner";
|
||
|
url = "${config.nixin.forge-runner.url}";
|
||
|
tokenFile = "${config.nixin.forge-runner.token-file}";
|
||
|
#token = "${config.nixin.forge-runner.token}";
|
||
|
labels = [
|
||
|
# provide a debian base with nodejs for actions
|
||
|
"debian-latest:docker://node:20-bookworm"
|
||
|
# fake the ubuntu name, because node provides no ubuntu builds
|
||
|
"ubuntu-latest:docker://node:20-bookworm"
|
||
|
# nixos
|
||
|
"nixos:docker://nixos/nix:latest"
|
||
|
# provide native execution on the host
|
||
|
#"native:host"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
|
||
|
# Open ports in the firewall.
|
||
|
networking.firewall.allowedUDPPorts = [ 53 ];
|
||
|
|
||
|
};
|
||
|
}
|