2022-04-10 20:57:52 +02:00
|
|
|
{
|
|
|
|
description = "NixOS configuration of our builders";
|
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
nixConfig.extra-substituters = [ "https://nix-community.cachix.org" ];
|
2022-04-18 07:42:44 +02:00
|
|
|
nixConfig.extra-trusted-public-keys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
];
|
|
|
|
|
2022-04-10 20:57:52 +02:00
|
|
|
inputs = {
|
2024-05-05 15:01:47 +10:00
|
|
|
agenix.inputs.darwin.follows = "nix-darwin";
|
2024-06-01 13:56:59 +10:00
|
|
|
agenix.inputs.home-manager.follows = "empty";
|
2024-06-01 13:49:55 +10:00
|
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
2024-05-30 10:10:06 +10:00
|
|
|
agenix.inputs.systems.follows = "systems";
|
2024-06-01 13:49:55 +10:00
|
|
|
agenix.url = "github:ryantm/agenix";
|
2023-10-25 11:53:51 +10:00
|
|
|
buildbot-nix.inputs.flake-parts.follows = "flake-parts";
|
2024-06-01 13:49:55 +10:00
|
|
|
buildbot-nix.inputs.nixpkgs.follows = "nixpkgs";
|
2023-10-25 11:53:51 +10:00
|
|
|
buildbot-nix.inputs.treefmt-nix.follows = "treefmt-nix";
|
2024-08-06 09:54:46 +10:00
|
|
|
buildbot-nix.url = "github:qowoz/buildbot-nix/skipped-build-workers";
|
2024-03-16 11:52:48 +10:00
|
|
|
comin.inputs.nixpkgs.follows = "nixpkgs";
|
2024-06-11 12:55:33 +10:00
|
|
|
comin.url = "github:nlewo/comin/d3658c452024824235de2355ac3e156b10c3eaaf";
|
2022-12-30 20:49:32 +01:00
|
|
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
2024-06-01 13:49:55 +10:00
|
|
|
disko.url = "github:nix-community/disko";
|
2024-06-01 13:56:59 +10:00
|
|
|
empty.url = "github:nix-systems/empty";
|
2023-04-12 13:20:42 +10:00
|
|
|
flake-compat.url = "github:nix-community/flake-compat";
|
2024-06-01 13:49:55 +10:00
|
|
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
2024-08-17 21:49:16 +10:00
|
|
|
lite-config.url = "github:yelite/lite-config";
|
2024-06-01 13:49:55 +10:00
|
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
|
|
nixpkgs-update-github-releases.flake = false;
|
|
|
|
nixpkgs-update-github-releases.url = "github:nix-community/nixpkgs-update-github-releases";
|
2024-06-01 13:56:59 +10:00
|
|
|
nixpkgs-update.inputs.mmdoc.follows = "empty";
|
2024-06-14 11:16:59 +10:00
|
|
|
nixpkgs-update.inputs.runtimeDeps.follows = "nixpkgs";
|
2024-06-01 13:49:55 +10:00
|
|
|
nixpkgs-update.inputs.treefmt-nix.follows = "treefmt-nix";
|
|
|
|
nixpkgs-update.url = "github:nix-community/nixpkgs-update";
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
|
|
|
nur-update.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
nur-update.url = "github:nix-community/nur-update";
|
2024-06-01 13:56:59 +10:00
|
|
|
sops-nix.inputs.nixpkgs-stable.follows = "empty";
|
2024-06-01 13:49:55 +10:00
|
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
|
|
srvos.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
srvos.url = "github:nix-community/srvos";
|
2024-05-30 10:10:06 +10:00
|
|
|
systems.url = "github:nix-systems/default";
|
2023-02-06 14:42:30 +10:00
|
|
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
2024-06-01 13:49:55 +10:00
|
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
2022-04-10 20:57:52 +02:00
|
|
|
};
|
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
outputs =
|
|
|
|
inputs@{ flake-parts, self, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
systems = import inputs.systems;
|
2023-05-16 06:54:11 +10:00
|
|
|
|
2024-08-17 21:49:16 +10:00
|
|
|
imports = [
|
|
|
|
inputs.lite-config.flakeModule
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
];
|
|
|
|
|
|
|
|
lite-config =
|
|
|
|
{ lib, ... }:
|
|
|
|
{
|
|
|
|
nixpkgs = {
|
|
|
|
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "terraform" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
hostModuleDir = ./hosts;
|
|
|
|
|
|
|
|
hosts = {
|
|
|
|
build01.system = "x86_64-linux";
|
|
|
|
build02.system = "x86_64-linux";
|
|
|
|
build03.system = "x86_64-linux";
|
|
|
|
build04.system = "aarch64-linux";
|
|
|
|
darwin01.system = "aarch64-darwin";
|
|
|
|
darwin02.system = "aarch64-darwin";
|
|
|
|
web02.system = "x86_64-linux";
|
|
|
|
};
|
|
|
|
|
|
|
|
systemModules = [
|
|
|
|
(
|
|
|
|
{ hostPlatform, ... }:
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
lib.optionals hostPlatform.isDarwin [ ./modules/darwin/common ]
|
|
|
|
++ lib.optionals hostPlatform.isLinux [ ./modules/nixos/common ];
|
|
|
|
}
|
|
|
|
)
|
|
|
|
];
|
|
|
|
};
|
2022-12-31 07:18:49 +01:00
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
perSystem =
|
|
|
|
{
|
|
|
|
inputs',
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
self',
|
|
|
|
system,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./dev/docs.nix
|
|
|
|
./dev/shell.nix
|
|
|
|
./terraform/shell.nix
|
|
|
|
];
|
|
|
|
treefmt = {
|
|
|
|
flakeCheck = system == "x86_64-linux";
|
|
|
|
imports = [ ./dev/treefmt.nix ];
|
|
|
|
};
|
2023-09-13 11:35:21 +10:00
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
checks =
|
|
|
|
let
|
|
|
|
darwinConfigurations = lib.mapAttrs' (
|
|
|
|
name: config: lib.nameValuePair name config.config.system.build.toplevel
|
|
|
|
) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.darwinConfigurations);
|
|
|
|
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
|
|
|
|
nixosConfigurations = lib.mapAttrs' (
|
|
|
|
name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel
|
|
|
|
) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
|
|
|
|
in
|
|
|
|
darwinConfigurations
|
|
|
|
// devShells
|
|
|
|
// {
|
|
|
|
inherit (self') formatter;
|
|
|
|
}
|
|
|
|
// nixosConfigurations
|
|
|
|
// pkgs.lib.optionalAttrs (system == "x86_64-linux") {
|
|
|
|
inherit (self'.packages) docs docs-linkcheck;
|
|
|
|
nixpkgs-update-supervisor-test = pkgs.callPackage ./hosts/build02/supervisor_test.nix { };
|
|
|
|
nixosTests-buildbot = pkgs.nixosTests.buildbot;
|
|
|
|
nixosTests-buildbot-nix-master = inputs'.buildbot-nix.checks.master;
|
|
|
|
nixosTests-buildbot-nix-worker = inputs'.buildbot-nix.checks.worker;
|
2024-09-02 13:06:43 +10:00
|
|
|
nixosTests-hydra = pkgs.nixosTests.hydra.hydra;
|
2024-06-01 19:33:53 +10:00
|
|
|
};
|
2024-07-24 19:05:26 +10:00
|
|
|
};
|
2024-06-01 19:33:53 +10:00
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
flake.darwinModules = {
|
|
|
|
builder = ./modules/darwin/builder.nix;
|
|
|
|
community-builder = ./modules/darwin/community-builder;
|
|
|
|
hercules-ci = ./modules/darwin/hercules-ci.nix;
|
|
|
|
remote-builder = ./modules/darwin/remote-builder.nix;
|
|
|
|
};
|
2023-07-17 13:53:06 +10:00
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
flake.nixosModules = {
|
|
|
|
buildbot = ./modules/nixos/buildbot.nix;
|
|
|
|
builder = ./modules/nixos/builder.nix;
|
|
|
|
community-builder = ./modules/nixos/community-builder;
|
|
|
|
disko-zfs = ./modules/nixos/disko-zfs.nix;
|
|
|
|
github-org-backup = ./modules/nixos/github-org-backup.nix;
|
|
|
|
hercules-ci = ./modules/nixos/hercules-ci.nix;
|
|
|
|
hydra = ./modules/nixos/hydra.nix;
|
|
|
|
monitoring = ./modules/nixos/monitoring;
|
|
|
|
nur-update = ./modules/nixos/nur-update.nix;
|
|
|
|
remote-builder = ./modules/nixos/remote-builder.nix;
|
|
|
|
watch-store = ./modules/nixos/watch-store.nix;
|
2022-09-07 17:47:16 +02:00
|
|
|
};
|
2024-07-24 19:05:26 +10:00
|
|
|
};
|
2022-04-10 20:57:52 +02:00
|
|
|
}
|