Compare commits

..

2 commits

3 changed files with 31 additions and 7 deletions

View file

@ -6,7 +6,7 @@
}: { }: {
# https://forgejo.org/docs/latest/admin/actions/ # https://forgejo.org/docs/latest/admin/actions/
services.gitea-actions-runner = { services.gitea-actions-runner = {
package = pkgs.gitea-actions-runner; # TODO: forgejo package = pkgs.forgejo-actions-runner;
instances."default" = { instances."default" = {
enable = true; enable = true;
name = "default"; name = "default";
@ -15,16 +15,17 @@
tokenFile = config.age.secrets.gitea-actions-runner-token-file.path; tokenFile = config.age.secrets.gitea-actions-runner-token-file.path;
# The Forgejo runner relies on application containers (Docker, Podman, # The Forgejo runner relies on application containers (Docker, Podman,
# etc) to execute a workflow in an isolated environment. Labels are used # etc) to execute a workflow in an isolated environment. Labels are used
# to map jobs' `runs-on` to their runtime environment. Note that changing # to map jobs' `runs-on` to their runtime environment. Many common
# these labels requires a new registration token. # actions require bash, git and nodejs, as well as a filesystem that
# follows the filesystem hierarchy standard.
labels = [ labels = [
"nixos-latest:docker://nixos/nix:2.21.0" "debian-latest:docker://node:20-bullseye"
]; ];
# https://forgejo.org/docs/latest/admin/actions/#configuration # https://forgejo.org/docs/latest/admin/actions/#configuration
settings = { settings = {
runner = { runner = {
# Default fetch interval is 2s -- no need to spam the server # Default fetch interval is 2s -- no need to spam the server
fetch_interval = "1m"; fetch_interval = "5m";
}; };
}; };
}; };
@ -37,4 +38,3 @@
group = "root"; group = "root";
}; };
} }

View file

@ -1,3 +1,3 @@
{...}: { {...}: {
imports = []; imports = [./forgejo-actions-runner.nix];
} }

View file

@ -0,0 +1,24 @@
{...}: {
# Running containers without /bin/sleep (such as nixos) requires newer
# forgejo act runner. See https://codeberg.org/forgejo/forgejo/issues/2611.
nixpkgs.overlays = [
(final: prev: {
forgejo-actions-runner = prev.callPackage "${prev.path}/pkgs/development/tools/continuous-integration/forgejo-actions-runner" {
buildGoModule = args:
prev.buildGoModule (args
// rec {
version = "3.4.1";
src = prev.fetchFromGitea {
domain = "codeberg.org";
owner = "forgejo";
repo = "runner";
rev = "v${version}";
hash = "sha256-c8heIHt+EJ6LnZT4/6TTWd7v85VRHjH72bdje12un4M=";
};
vendorHash = "sha256-FCCQZdAYRtJR3DGQIEvUzv+1kqvxVTGkwJwZSohq28s=";
});
};
})
];
}