forgejo-ci-runners/agents/linux.nix

91 lines
1.8 KiB
Nix
Raw Normal View History

2024-05-14 12:03:36 -05:00
{ pkgs, config, lib, ... }:
let
in {
environment.systemPackages = with pkgs; [
vim
# zig broken on darwin
#ncdu
git
tmux
cachix
direnv
2024-05-14 14:21:22 -05:00
lazydocker
lazygit
2024-05-14 12:03:36 -05:00
];
sops.secrets."forgejo-runner-token" = {
# configure secret for forwarding rules
sopsFile = ./secrets.sops.yaml;
mode = "0444";
2024-05-14 13:22:24 -05:00
restartUnits = [ "gitea-runner-default.service" ];
2024-05-14 12:03:36 -05:00
};
virtualisation.docker.enable = true;
2024-05-14 13:38:39 -05:00
users.users.gitea-runner.group = "gitea-runner";
2024-05-14 13:41:38 -05:00
users.groups.gitea-runner = {};
2024-05-14 13:38:39 -05:00
users.users.gitea-runner.extraGroups = [ "docker" ];
users.users.gitea-runner.isNormalUser = true;
# Runner communication port for cache restores.
networking.firewall.allowedTCPPorts = [ 45315 ];
2024-05-14 12:03:36 -05:00
services.gitea-actions-runner = {
package = pkgs.forgejo-actions-runner;
instances.default = {
enable = true;
name = "monolith";
url = "https://git.hsn.dev";
# Obtaining the path to the runner token file may differ
tokenFile = config.sops.secrets.forgejo-runner-token.path;
labels = [
2024-05-20 08:46:49 -05:00
"docker:docker://node:20-bullseye"
"aarch64"
"linux"
"pc"
2024-05-14 12:03:36 -05:00
## optionally provide native execution on the host:
# "native:host"
];
};
};
system.stateVersion = "24.05";
}
# extraPackages = with pkgs; [
# # custom
# cachix
# tmate
# jq
# # nixos
# docker
# openssh
# coreutils-full
# bashInteractive # bash with ncurses support
# bzip2
# cpio
# curl
# diffutils
# findutils
# gawk
# stdenv.cc.libc
# getent
# getconf
# gnugrep
# gnupatch
# gnused
# gnutar
# gzip
# xz
# less
# ncurses
# netcat
# mkpasswd
# procps
# time
# zstd
# util-linux
# which
# nixos-rebuild
# ];