infrastructure/modules/nixos/dgn-forgejo-runners.nix
soyouzpanda 8cfc0001b9
Some checks failed
Check meta / check_dns (pull_request) Successful in 16s
Check workflows / check_workflows (pull_request) Successful in 17s
Build all the nodes / netcore02 (pull_request) Successful in 22s
Check meta / check_meta (pull_request) Successful in 31s
Build all the nodes / ap01 (pull_request) Successful in 34s
Build the shell / build-shell (pull_request) Successful in 25s
Run pre-commit on all files / pre-commit (pull_request) Successful in 24s
Build all the nodes / hypervisor02 (pull_request) Successful in 1m56s
Build all the nodes / build01 (pull_request) Successful in 1m59s
Build all the nodes / bridge01 (pull_request) Successful in 2m6s
Build all the nodes / tower01 (pull_request) Successful in 2m4s
Build all the nodes / geo02 (pull_request) Successful in 2m6s
Build all the nodes / rescue01 (pull_request) Successful in 2m13s
Build all the nodes / web02 (pull_request) Successful in 2m15s
Build all the nodes / hypervisor03 (pull_request) Successful in 2m20s
Build all the nodes / storage01 (pull_request) Successful in 2m26s
Build all the nodes / geo01 (pull_request) Successful in 2m26s
Build all the nodes / vault01 (pull_request) Successful in 2m28s
Build all the nodes / hypervisor01 (pull_request) Successful in 2m35s
Build all the nodes / web03 (pull_request) Successful in 2m33s
Build all the nodes / web01 (pull_request) Successful in 2m49s
Build all the nodes / compute01 (pull_request) Successful in 2m59s
Check meta / check_meta (push) Successful in 15s
Check meta / check_dns (push) Successful in 31s
Build all the nodes / ap01 (push) Successful in 33s
Build all the nodes / netcore02 (push) Successful in 41s
Build all the nodes / rescue01 (push) Has been cancelled
Build all the nodes / web03 (push) Has been cancelled
Build all the nodes / storage01 (push) Has been cancelled
Build all the nodes / hypervisor01 (push) Has been cancelled
Build all the nodes / geo02 (push) Has been cancelled
Build all the nodes / build01 (push) Has been cancelled
Build all the nodes / tower01 (push) Has been cancelled
Build all the nodes / bridge01 (push) Has been cancelled
Build all the nodes / compute01 (push) Has been cancelled
Build all the nodes / web02 (push) Has been cancelled
Build all the nodes / geo01 (push) Has been cancelled
Build all the nodes / hypervisor02 (push) Has been cancelled
Build all the nodes / web01 (push) Has been cancelled
Build all the nodes / vault01 (push) Has been cancelled
Build all the nodes / hypervisor03 (push) Has been cancelled
Run pre-commit on all files / pre-commit (push) Has been cancelled
Build the shell / build-shell (push) Has been cancelled
feat(build01): Init
2025-01-09 23:08:08 +01:00

91 lines
1.8 KiB
Nix

# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
# SPDX-FileContributor: Elias Coppens <elias@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{
config,
lib,
pkgs,
name,
...
}:
let
inherit (lib) mkEnableOption mkIf mkOption;
inherit (lib.types) int nullOr str;
cfg = config.dgn-forgejo-runners;
in
{
options.dgn-forgejo-runners = {
enable = mkEnableOption "forgejo-nix-runners for the DGNum forge";
nbRunners = mkOption {
type = int;
description = ''
Number of runners to spawn.
'';
};
nbCpus = mkOption {
type = nullOr int;
default = null;
description = ''
Maximum number of cores available for each runner.
When set to null, there will be no restriction.
'';
};
dataDirectory = mkOption {
type = str;
description = ''
Base directory to store data for runners.
'';
};
};
config = mkIf cfg.enable {
services.forgejo-nix-runners = {
enable = true;
url = "https://git.dgnum.eu";
storePath = cfg.dataDirectory;
tokenFile = config.age.secrets."forgejo_runners-token_file".path;
names = [
"on-${name}"
];
dependencies = [
pkgs.npins
pkgs.tea
];
containerOptions = lib.optional (cfg.nbCpus != null) "--cpus=${builtins.toString cfg.nbCpus}";
inherit (cfg) nbRunners;
};
virtualisation = {
podman = {
enable = true;
defaultNetwork.settings = {
dns_enable = true;
ipv6_enabled = true;
};
};
containers.storage.settings = {
storage = {
driver = "overlay";
graphroot = "${cfg.dataDirectory}/containers/storage";
runroot = "/run/containers/storage";
};
};
};
};
}