chore: remove vm-gitlab which is no longer in use
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
./ceph.nix
|
||||
./db.nix
|
||||
./gitea-runner.nix
|
||||
./gitlab-runner.nix
|
||||
./gnome.nix
|
||||
./home.nix
|
||||
./kde.nix
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.greg.runner;
|
||||
environmentVariables = {
|
||||
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
|
||||
STORAGE_URL = "s3.thehellings.lan:9000";
|
||||
};
|
||||
runnerCfg = file: {
|
||||
inherit environmentVariables;
|
||||
authenticationTokenConfigFile = file;
|
||||
executor = "shell";
|
||||
limit = cfg.threads;
|
||||
};
|
||||
in
|
||||
# We want exactly one of these to be true, but not both. Neither can both be false
|
||||
{
|
||||
options.greg.runner = {
|
||||
enable = lib.mkEnableOption "Enable as a gitlab-runner with both libvirt and virtualbox";
|
||||
|
||||
threads = lib.mkOption {
|
||||
default = 5;
|
||||
type = lib.types.int;
|
||||
description = "The maximum number of concurrent jobs";
|
||||
};
|
||||
|
||||
qemu = lib.mkEnableOption "Enable the qemu host (mutually exclusive with vbox)";
|
||||
vbox = lib.mkEnableOption "Enable the vbox host (mutually exclusive with qemu)";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable ({
|
||||
# assertions = [
|
||||
# {
|
||||
# assertion = cfg.qemu || cfg.vbox && (cfg.qemu != cfg.vbox);
|
||||
# message = "You must enable exactly one of qemu or vbox";
|
||||
# }
|
||||
# ];
|
||||
# Shared configurations
|
||||
age.secrets = {
|
||||
qemu.file = ../../secrets/gitlab/nixos-qemu-shell.age;
|
||||
vbox.file = ../../secrets/gitlab/nixos-vbox-shell.age;
|
||||
};
|
||||
|
||||
services.gitlab-runner = {
|
||||
enable = false;
|
||||
settings.concurrent = cfg.threads;
|
||||
services = {
|
||||
qemu = lib.mkIf cfg.qemu (runnerCfg config.age.secrets.qemu.path);
|
||||
vbox = lib.mkIf cfg.vbox (runnerCfg config.age.secrets.vbox.path);
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.gitlab-runner = {
|
||||
serviceConfig = {
|
||||
DevicePolicy = lib.mkForce "auto";
|
||||
User = "root";
|
||||
DynamicUser = lib.mkForce false;
|
||||
};
|
||||
};
|
||||
|
||||
users.extraGroups.vboxusers.members = lib.optional cfg.vbox "greg";
|
||||
|
||||
virtualisation = {
|
||||
libvirtd = lib.mkIf cfg.qemu {
|
||||
enable = true;
|
||||
allowedBridges = [
|
||||
"br0"
|
||||
"virbr0"
|
||||
];
|
||||
onBoot = "ignore"; # only restart VMs labeled 'autostart'
|
||||
};
|
||||
virtualbox.host = lib.mkIf cfg.vbox {
|
||||
enable = true;
|
||||
enableExtensionPack = true;
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -18,7 +18,6 @@ with lib;
|
||||
devices = {
|
||||
chronicles.id = "7FI6Y3M-C7YQEDI-IB345L6-RKLXMB6-AEIV57Y-3J2RCXQ-MK6QRNK-EINPXAE";
|
||||
genesis.id = "YDTH4SD-GUAC5AA-SSYWYPZ-YMJW5LK-LE7PZKJ-GV2UJFZ-CU7LZAD-GTYWCQK";
|
||||
gitlab.id = "GKNOZWI-CNC2Q2F-R5GGGDX-RYFGHK4-CCC37LC-GVOEMJI-46QPC6G-AWFEOQE";
|
||||
linode.id = "IJMMXPR-WNALZBD-FMJH5W5-WV7XGJY-HLJTKGT-5TKHJIH-75LT56D-UUZCYQE";
|
||||
};
|
||||
options = {
|
||||
|
||||
Reference in New Issue
Block a user