diff --git a/components/network/nginx.nix b/components/network/nginx.nix index 89ba6c6..f0f48ee 100644 --- a/components/network/nginx.nix +++ b/components/network/nginx.nix @@ -117,6 +117,11 @@ with lib; href = "http://10.100.0.1:2342/"; image = "https://media.giphy.com/media/fyLi0OuWysotq/giphy.gif"; } + { + label = "Build Bot"; + href = "http://orbi.private:8010"; + image = "https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExd2gxZDg4Mm92c280OWxlZXJoZ3V6MWozamI5c3M2dnd1M3pma2lydiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/UqcFByCQIOloWRXUxs/giphy.gif"; + } ]; }) (entry { diff --git a/flake.lock b/flake.lock index 44ca74c..b096e36 100644 --- a/flake.lock +++ b/flake.lock @@ -114,6 +114,26 @@ "type": "github" } }, + "buildbot-nix": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1720975977, + "narHash": "sha256-9x2Yjsw6t++go/jZ5prKGJFDl4b5+ei5eCgm10xorDI=", + "owner": "nix-community", + "repo": "buildbot-nix", + "rev": "93942c0a662b7c6ad80810ae9f99f80988a27b1d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "buildbot-nix", + "type": "github" + } + }, "clan-core": { "inputs": { "disko": "disko", @@ -125,7 +145,7 @@ "nixpkgs" ], "sops-nix": "sops-nix", - "treefmt-nix": "treefmt-nix" + "treefmt-nix": "treefmt-nix_2" }, "locked": { "lastModified": 1720716544, @@ -146,8 +166,8 @@ "clan-core": [ "clan-core" ], - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1720813949, @@ -223,6 +243,27 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "buildbot-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, @@ -240,7 +281,7 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nixpkgs" @@ -260,7 +301,7 @@ "type": "github" } }, - "flake-parts_3": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "nixos-anywhere", @@ -382,7 +423,7 @@ }, "home-manager": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1720734513, @@ -443,7 +484,7 @@ "landingpage": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1709213960, @@ -462,11 +503,11 @@ "nixos-anywhere": { "inputs": { "disko": "disko_2", - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "nixos-images": "nixos-images_2", "nixos-stable": "nixos-stable", - "nixpkgs": "nixpkgs_4", - "treefmt-nix": "treefmt-nix_2" + "nixpkgs": "nixpkgs_5", + "treefmt-nix": "treefmt-nix_3" }, "locked": { "lastModified": 1719852663, @@ -564,16 +605,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1717196966, - "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", - "owner": "NixOS", + "lastModified": 1720890539, + "narHash": "sha256-1K32XHPcQBo8XdLDQNybfLQc9I8hqSZdjA/Ur3zW/io=", + "owner": "Nixos", "repo": "nixpkgs", - "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "rev": "19116ccf234e32acf133863d430506da68008550", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", + "owner": "Nixos", + "ref": "nixos-unstable-small", "repo": "nixpkgs", "type": "github" } @@ -655,6 +696,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1717196966, + "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1719848872, "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", @@ -670,7 +727,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1645527175, "narHash": "sha256-WeewqaO48sCctiN+iwgZZEJRU29Si7vHHoLCINAvuk8=", @@ -685,7 +742,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1717926692, "narHash": "sha256-THcv8qDqobZefHHluPjx/8n+MtVVb8ag/oJbKMqKNRo=", @@ -701,7 +758,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1720542800, "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", @@ -717,7 +774,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1701263465, "narHash": "sha256-lNXUIlkfyDyp9Ox21hr+wsEf/IBklLvb6bYcyeXbdRc=", @@ -733,7 +790,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1632855891, "narHash": "sha256-crW76mt9/kbUBiKy/KiSnsQ9JEYgD3StDuYAMVkTbM0=", @@ -747,7 +804,7 @@ "type": "indirect" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1720585496, "narHash": "sha256-UONPcQR2r0voopd6pcNFmUv7p4TJPeAXzwnqWmaPujw=", @@ -766,7 +823,7 @@ "overviewer": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "pandoc_template": "pandoc_template" }, "locked": { @@ -823,7 +880,7 @@ "polygon-art": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1688766095, @@ -872,16 +929,17 @@ }, "root": { "inputs": { + "buildbot-nix": "buildbot-nix", "clan-core": "clan-core", "clan-fact-generators": "clan-fact-generators", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "home-manager": "home-manager", "home-manager-utils": "home-manager-utils", "kmonad": "kmonad", "landingpage": "landingpage", "nixos-anywhere": "nixos-anywhere", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nixpkgs-legacy_2211": "nixpkgs-legacy_2211", "nixpkgs-legacy_2311": "nixpkgs-legacy_2311", "nixpkgs-legacy_2405": "nixpkgs-legacy_2405", @@ -940,7 +998,7 @@ }, "srvos": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1720691926, @@ -1040,6 +1098,27 @@ } }, "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "buildbot-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720818892, + "narHash": "sha256-f52x9srIcqQm1Df3T+xYR5P6VfdnDFa2vkkcLhlTp6U=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "5b002f8a53ed04c1a4177e7b00809d57bd2c696f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "clan-core", @@ -1060,7 +1139,7 @@ "type": "github" } }, - "treefmt-nix_2": { + "treefmt-nix_3": { "inputs": { "nixpkgs": [ "nixos-anywhere", diff --git a/flake.nix b/flake.nix index b1a45a8..b384187 100644 --- a/flake.nix +++ b/flake.nix @@ -81,6 +81,8 @@ inputs.home-manager.follows = "home-manager"; }; + buildbot-nix.url = "github:nix-community/buildbot-nix"; + # smoke test framwork to trigger tests (enable if I want to use it for real) #smoke = { # url = github:SamirTalwar/smoke; @@ -99,6 +101,7 @@ outputs = inputs@{ self + , buildbot-nix , clan-core , clan-fact-generators , flake-parts @@ -172,7 +175,7 @@ ]; }; specialArgs = { - inherit private_assets; + inherit private_assets inputs; assets = ./assets; factsGenerator = clan-fact-generators.lib { inherit pkgs; }; clanLib = import ./lib/clanlib.nix { inherit (pkgs) lib; machineDir = ./machines; }; @@ -486,3 +489,4 @@ }); } + diff --git a/machines/orbi/buildbot-master.nix b/machines/orbi/buildbot-master.nix new file mode 100644 index 0000000..243a4bb --- /dev/null +++ b/machines/orbi/buildbot-master.nix @@ -0,0 +1,41 @@ +{ pkgs, inputs, ... }: { + + imports = [ + inputs.buildbot-nix.nixosModules.buildbot-master + ]; + + containers.buildbot = { + privateNetwork = false; + autoStart = true; + + config = { config, lib, ... }: { + nixpkgs.pkgs = pkgs; + imports = [ + ../../components/monitor/container.nix + inputs.buildbot-nix.nixosModules.buildbot-master + ]; + system.stateVersion = "24.05"; + services.logrotate.checkConfig = false; # because uid 3000 does not exist in here + + services.postgresql = { + settings.port = 5433; + }; + + services.buildbot-nix.master = { + enable = true; + dbUrl = "postgresql://@:5433/buildbot"; + # Domain name under which the buildbot frontend is reachable + domain = "orbi.private:8010"; + admins = [ "palo" ]; + authBackend = "none"; + workersFile = pkgs.writeText "workers.json" '' + [ + { "name": "test", "pass": "password", "cores": 2 } + ] + ''; + }; + + }; + }; + +} diff --git a/machines/orbi/buildbot-worker.nix b/machines/orbi/buildbot-worker.nix new file mode 100644 index 0000000..abfe3aa --- /dev/null +++ b/machines/orbi/buildbot-worker.nix @@ -0,0 +1,12 @@ +{ pkgs, inputs, ... }: { + + imports = [ + inputs.buildbot-nix.nixosModules.buildbot-worker + ]; + + services.buildbot-nix.worker = { + enable = true; + workerPasswordFile = pkgs.writeText "worker-password-file" "password"; + }; + +} diff --git a/machines/orbi/configuration.nix b/machines/orbi/configuration.nix index fea7803..8302aa5 100644 --- a/machines/orbi/configuration.nix +++ b/machines/orbi/configuration.nix @@ -32,6 +32,9 @@ #./social-jitsi.nix ./social-matrix-terranix.nix + ./buildbot-worker.nix + ./buildbot-master.nix + ]; services.logrotate.checkConfig = false; # because uid 3000 does not exist in here