Files
athenix/sw/builders/services.nix
UGA Innovation Factory 90688ec5f1
All checks were successful
CI / Flake Check (push) Successful in 1m15s
CI / Format Check (push) Successful in 1s
CI / Evaluate Key Configurations (nix-builder) (push) Successful in 9s
CI / Evaluate Key Configurations (nix-desktop1) (push) Successful in 11s
CI / Evaluate Key Configurations (nix-laptop1) (push) Successful in 8s
CI / Evaluate Artifacts (installer-iso-nix-laptop1) (push) Successful in 16s
CI / Evaluate Artifacts (lxc-nix-builder) (push) Successful in 11s
just evaluate instead of building artificats for CI
2025-12-18 12:55:27 -05:00

57 lines
1.7 KiB
Nix

{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.athenix.sw;
builderCfg = cfg.builders;
in
mkIf builderCfg.giteaRunner.enable {
services.gitea-actions-runner.instances.${builderCfg.giteaRunner.name} = {
enable = true;
url = builderCfg.giteaRunner.url;
tokenFile = builderCfg.giteaRunner.tokenFile;
labels = builderCfg.giteaRunner.extraLabels;
name = builderCfg.giteaRunner.name;
};
# Configure the systemd service for better handling in LXC containers
systemd.services."gitea-runner-${builderCfg.giteaRunner.name}" = {
unitConfig = {
# Only start the service if token file exists
# This allows graceful deployment before the token is manually installed
ConditionPathExists = builderCfg.giteaRunner.tokenFile;
};
serviceConfig = {
# Give the service more time to stop cleanly
TimeoutStopSec = mkForce 60;
# Add Node.js and other tools to PATH for GitHub Actions compatibility
Environment = [
"PATH=${pkgs.nodejs}/bin:${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.git}/bin:${pkgs.nix}/bin:/run/current-system/sw/bin"
];
# Disable all namespace isolation features that don't work in LXC containers
PrivateMounts = mkForce false;
MountAPIVFS = mkForce false;
BindPaths = mkForce [ ];
BindReadOnlyPaths = mkForce [ ];
PrivateTmp = mkForce false;
PrivateDevices = mkForce false;
ProtectSystem = mkForce false;
ProtectHome = mkForce false;
ReadOnlyPaths = mkForce [ ];
InaccessiblePaths = mkForce [ ];
PrivateUsers = mkForce false;
ProtectKernelTunables = mkForce false;
ProtectKernelModules = mkForce false;
ProtectControlGroups = mkForce false;
};
};
}