Files
nixos/hosts/myself/container-runner.nix
T

85 lines
1.4 KiB
Nix
Raw Normal View History

2023-12-27 20:27:38 -06:00
{ inputs, name, extra ? {}, packages ? [] }:
2023-12-17 15:47:52 -06:00
({ config, pkgs, lib, ... }:
let
py = (pkgs.python3.withPackages (p: with p; [
pip
pyyaml
virtualenv
]));
in (
2023-12-17 19:54:28 -06:00
lib.attrsets.recursiveUpdate {
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
imports = [
inputs.agenix.nixosModules.default
2024-02-09 16:23:42 -06:00
inputs.self.modules.nixosModule
2023-12-17 19:54:28 -06:00
];
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
age = {
identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets.runner-reg = {
file = ../../secrets/gitlab/myself-${name}-runner-reg.age;
owner = "gitlab-runner";
2023-12-17 15:47:52 -06:00
};
2023-12-17 19:54:28 -06:00
};
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
environment.systemPackages = with pkgs; [
curl
gawk
git
2023-12-19 13:45:06 -06:00
p7zip
2023-12-17 19:54:28 -06:00
packer
pup
py
shellcheck
2023-12-19 13:45:06 -06:00
unzip
2023-12-27 20:27:38 -06:00
xonsh
2023-12-17 19:54:28 -06:00
xorriso
2023-12-22 13:19:06 -06:00
vagrant
2023-12-19 13:45:06 -06:00
wget
2023-12-27 20:27:38 -06:00
] ++ packages;
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
networking = {
useHostResolvConf = pkgs.lib.mkForce false;
nameservers = [ "100.100.100.100" ];
};
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
nixpkgs.config.allowUnfree = true;
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
services = {
gitlab-runner = {
enable = true;
settings.concurrent = 5;
services = {
shell = {
executor = "shell";
limit = 5;
registrationConfigFile = config.age.secrets.runner-reg.path;
2024-01-19 22:38:37 -06:00
environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
};
2023-12-17 15:47:52 -06:00
};
};
};
2023-12-17 19:54:28 -06:00
resolved.enable = true;
};
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
systemd.services.gitlab-runner = {
2023-12-27 20:27:38 -06:00
wants = [
"network-online.target"
"systemd-resolved.service"
];
after = [
"network.target"
"network-online.target"
"systemd-resolved.service"
];
2023-12-17 19:54:28 -06:00
};
2023-12-17 15:47:52 -06:00
2024-02-09 16:23:42 -06:00
system.stateVersion = lib.mkForce "24.05";
2023-12-17 19:54:28 -06:00
}
2023-12-17 15:47:52 -06:00
2023-12-17 19:54:28 -06:00
extra
2023-12-17 15:47:52 -06:00
) # End of attrsets.recursiveUpdate
) # End of outter function wrapper