| 1 | let |
| 2 | rabbitmq = { |
| 3 | host = "messages.ofborg.org"; |
| 4 | ssl = true; |
| 5 | virtualhost = "ofborg"; |
| 6 | # Missing: username and password_file |
| 7 | }; |
| 8 | in |
| 9 | { |
| 10 | config, |
| 11 | pkgs, |
| 12 | ... |
| 13 | }: |
| 14 | { |
| 15 | environment.etc."ofborg.json".text = builtins.toJSON { |
| 16 | github_webhook_receiver = { |
| 17 | listen = "[::1]:9899"; |
| 18 | webhook_secret_file = "/run/secrets/ofborg/github-webhook-secret"; |
| 19 | rabbitmq = rabbitmq // { |
| 20 | username = "ofborg-github-webhook"; |
| 21 | password_file = "/run/secrets/ofborg/github-webhook-rabbitmq-password"; |
| 22 | }; |
| 23 | }; |
| 24 | log_api_config = { |
| 25 | listen = "[::1]:9898"; |
| 26 | logs_path = "/var/log/ofborg"; |
| 27 | serve_root = "https://logs.ofborg.org/logfile"; |
| 28 | }; |
| 29 | evaluation_filter = { |
| 30 | rabbitmq = rabbitmq // { |
| 31 | username = "ofborg-evaluation-filter"; |
| 32 | password_file = "/run/secrets/ofborg/evaluation-filter-rabbitmq-password"; |
| 33 | }; |
| 34 | }; |
| 35 | github_comment_filter = { |
| 36 | rabbitmq = rabbitmq // { |
| 37 | username = "ofborg-github-comment-filter"; |
| 38 | password_file = "/run/secrets/ofborg/github-comment-filter-rabbitmq-password"; |
| 39 | }; |
| 40 | }; |
| 41 | github_comment_poster = { |
| 42 | rabbitmq = rabbitmq // { |
| 43 | username = "ofborg-github-comment-poster"; |
| 44 | password_file = "/run/secrets/ofborg/github-comment-poster-rabbitmq-password"; |
| 45 | }; |
| 46 | }; |
| 47 | log_message_collector = { |
| 48 | rabbitmq = rabbitmq // { |
| 49 | username = "ofborg-log-message-collector"; |
| 50 | password_file = "/run/secrets/ofborg/log-message-collector-rabbitmq-password"; |
| 51 | }; |
| 52 | logs_path = "/var/log/ofborg"; |
| 53 | }; |
| 54 | mass_rebuilder = { |
| 55 | rabbitmq = rabbitmq // { |
| 56 | username = "${config.networking.hostName}"; |
| 57 | password_file = "/run/secrets/ofborg/mass-rebuilder-rabbitmq-password"; |
| 58 | }; |
| 59 | }; |
| 60 | runner = { |
| 61 | identity = "ofborg-core"; # TODO what is this |
| 62 | repos = [ |
| 63 | "nixos/nixpkgs" |
| 64 | "ofborg/testpkgs" |
| 65 | ]; |
| 66 | disable_trusted_users = true; |
| 67 | trusted_users = [ ]; # disabled so everyone can build |
| 68 | }; |
| 69 | builder = { |
| 70 | rabbitmq = rabbitmq // { |
| 71 | username = "${config.networking.hostName}"; |
| 72 | password_file = "/run/secrets/ofborg/builder-rabbitmq-password"; |
| 73 | }; |
| 74 | }; |
| 75 | github_app = { |
| 76 | app_id = 20500; # Used for submitting statuses |
| 77 | private_key = "/run/secrets/ofborg/github-app-key"; # Used for submitting statuses |
| 78 | oauth_client_id = "Iv1.24d6e782e2ccbbdf"; # For accessing the API |
| 79 | oauth_client_secret_file = "/run/secrets/ofborg/github-oauth-secret"; # For accessing the API |
| 80 | }; |
| 81 | |
| 82 | checkout.root = "/var/lib/ofborg/checkout"; |
| 83 | nix = { |
| 84 | build_timeout_seconds = 18000; |
| 85 | initial_heap_size = "4g"; |
| 86 | remote = "daemon"; |
| 87 | inherit (pkgs.stdenv.hostPlatform) system; |
| 88 | }; |
| 89 | }; |
| 90 | |
| 91 | nix.settings.trusted-users = [ |
| 92 | "ofborg-builder" |
| 93 | ]; |
| 94 | } |