add some example nixos configuration

This commit is contained in:
Jörg Thalheim 2023-09-10 10:11:50 +00:00
parent 6fbe58a327
commit f81c71a328
4 changed files with 28 additions and 7 deletions

View file

@ -1,7 +1,7 @@
{ nixpkgs, system, buildbot-nix, ... }:
let
# some example configuration to make it eval
dummy = { config, ... }: {
dummy = { config, modulesPath, ... }: {
networking.hostName = "example-common";
system.stateVersion = config.system.nixos.version;
users.users.root.initialPassword = "fnord23";
@ -11,21 +11,40 @@ let
inherit (nixpkgs) lib;
inherit (lib) nixosSystem;
in
{
# General
example-master = nixosSystem {
example-master = lib.makeOverridable nixosSystem {
inherit system;
modules = [
dummy
{
services.buildbot-nix.master = {
enable = true;
url = "https://buildbot.thalheim.io";
workersFile = "/home/mic92/buildbot-nix/workers.json";
github = {
tokenFile = "/home/mic92/git/buildbot-nix/github-token";
webhookSecretFile = "/home/mic92/buildbot-nix/github-webhook-secret";
oauthSecretFile = "/home/mic92/buildbot-nix/github-oauth-secret";
oauthId = "2516248ec6289e4d9818122cce0cbde39e4b788d";
githubUser = "mic92-buildbot";
githubAdmins = [ "Mic92" ];
};
};
}
buildbot-nix.nixosModules.buildbot-master
];
};
example-worker = nixosSystem {
example-worker = lib.makeOverridable nixosSystem {
inherit system;
modules = [
dummy
{
services.buildbot-nix.worker = {
enable = true;
workerPasswordFile = "/home/mic92/buildbot-nix/worker-password";
};
}
buildbot-nix.nixosModules.buildbot-worker
];
};

View file

@ -9,7 +9,7 @@
outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
systems = lib.systems.flakeExposed;
systems = [ "x86_64-linux" ];
flake = {
nixosModules.buildbot-master = ./nix/master.nix;
nixosModules.buildbot-worker = ./nix/worker.nix;

View file

@ -59,10 +59,12 @@ in
};
buildSystems = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ pkgs.hostPlatform.system ];
description = "Systems that we will be build";
};
evalMaxMemorySize = lib.mkOption {
type = lib.types.str;
default = "2048";
description = ''
Maximum memory size for nix-eval-jobs (in MiB) per
worker. After the limit is reached, the worker is
@ -113,6 +115,7 @@ in
};
services.postgresql = {
enable = true;
ensureDatabases = [ "buildbot" ];
ensureUsers = [
{

View file

@ -26,7 +26,6 @@ in
};
workerPasswordFile = lib.mkOption {
type = lib.types.str;
default = "/var/lib/buildbot-worker/worker-password";
description = "The buildbot worker password file.";
};
};