Skip to content
Snippets Groups Projects
Commit b8cb2d34 authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

nixos: Flakify

parent 20af8f0c
Branches wip/flakes
No related tags found
No related merge requests found
# Usage:
#
# {
# inputs.ghc-gitlab-runner.url = "git+https://gitlab.haskell.org/ghc/ci-config";
# outputs = inputs: {
# nixosConfigurations.machine = nixpkgs.lib.nixosSystem {
# modules = [
# inputs.ghc-gitlab-runner.nixosModules.ghc-runner-common
# inputs.ghc-gitlab-runner.nixosModules.ghc-runner
# inputs.ghc-gitlab-runner.nixosModules.ghc-runner-freebsd
# ];
# {
# ghc-gitlab-runner.token = "REGISTRATION TOKEN";
# ghc-gitlab-runner.name = "NAME";
# }
# };
# };
# }
{
outputs = { self }: {
nixosModules.ghc-runner-common = { lib, ... }: {
config.virtualisation.docker = {
enable = true;
autoPrune = {
enable = true;
flags = [ "--force" "--all" "--volumes" ];
dates = "daily";
};
};
options.ghc-gitlab-runner.name = lib.mkOption {
type = lib.types.str;
description = "GitLab runner name";
};
options.ghc-gitlab-runner.token = lib.mkOption {
type = lib.types.str;
description = "GitLab registration token";
};
};
nixosModules.ghc-runner = {config, ...}: {
imports = [
(import ./nixos/ci-worker.nix {
name = config.ghc-gitlab-runner.name;
cores = 16;
token = config.ghc-gitlab-runner.token;
lintToken = config.ghc-gitlab-runner.token;
})
];
};
nixosModules.ghc-runner-freebsd = {config, ...}: {
imports = [
(import ./nixos/freebsd-runner.nix {
runnerName = config.ghc-gitlab-runner.name;
token = config.ghc-gitlab-runner.token;
cores = 4;
})
];
};
};
}
......@@ -72,6 +72,8 @@ in
User = "gitlab-runner";
Group = "gitlab-runner";
};
virtualisation.libvirtd.enable = true;
users.groups.gitlab-runner = { };
users.users.gitlab-runner = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment