2022-04-10 20:57:52 +02:00
|
|
|
{
|
|
|
|
description = "NixOS configuration of our builders";
|
|
|
|
|
2022-04-18 07:42:44 +02:00
|
|
|
nixConfig.extra-substituters = [
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
];
|
|
|
|
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-06-01 13:49:55 +10:00
|
|
|
buildbot-nix.url = "github:Mic92/buildbot-nix";
|
2024-03-16 11:52:48 +10:00
|
|
|
comin.inputs.nixpkgs.follows = "nixpkgs";
|
2024-06-01 13:49:55 +10:00
|
|
|
comin.url = "github:nlewo/comin";
|
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";
|
2024-06-01 13:49:55 +10:00
|
|
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
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-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
|
|
|
};
|
|
|
|
|
2023-04-06 11:49:28 +10:00
|
|
|
outputs = inputs @ { flake-parts, self, ... }:
|
2023-05-16 06:54:11 +10:00
|
|
|
flake-parts.lib.mkFlake
|
|
|
|
{ inherit inputs; }
|
|
|
|
{
|
2024-05-30 10:10:06 +10:00
|
|
|
systems = import inputs.systems;
|
2023-05-16 06:54:11 +10:00
|
|
|
|
|
|
|
imports = [
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
];
|
2022-12-31 07:18:49 +01:00
|
|
|
|
2024-05-25 10:15:05 +10:00
|
|
|
perSystem = { inputs', lib, pkgs, self', system, ... }:
|
2023-09-13 11:35:21 +10:00
|
|
|
{
|
|
|
|
imports = [
|
2024-05-25 10:15:05 +10:00
|
|
|
./dev/docs.nix
|
2023-09-13 11:35:21 +10:00
|
|
|
./dev/shell.nix
|
|
|
|
./terraform/shell.nix
|
|
|
|
];
|
|
|
|
treefmt = {
|
2024-05-24 14:05:23 +10:00
|
|
|
flakeCheck = system == "x86_64-linux";
|
2023-09-13 11:35:21 +10:00
|
|
|
imports = [ ./dev/treefmt.nix ];
|
|
|
|
};
|
|
|
|
|
2024-06-01 19:33:53 +10:00
|
|
|
_module.args.pkgs = import inputs.nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
|
|
|
"terraform"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-10-31 11:04:53 +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
|
2024-05-24 14:05:23 +10:00
|
|
|
darwinConfigurations // devShells // { inherit (self') formatter; } // nixosConfigurations
|
|
|
|
// pkgs.lib.optionalAttrs (system == "x86_64-linux")
|
|
|
|
{
|
2024-06-01 08:22:31 +10:00
|
|
|
inherit (self'.packages) docs docs-linkcheck;
|
2024-05-24 14:05:23 +10:00
|
|
|
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;
|
|
|
|
nixosTests-hydra = pkgs.nixosTests.hydra.hydra_unstable;
|
|
|
|
};
|
2023-07-14 17:11:27 +10:00
|
|
|
};
|
|
|
|
|
2023-05-16 18:58:13 +10:00
|
|
|
flake.darwinConfigurations =
|
|
|
|
let
|
2024-05-27 10:48:18 +10:00
|
|
|
darwinSystem = args:
|
|
|
|
inputs.nix-darwin.lib.darwinSystem ({ specialArgs = { inherit inputs; }; } // args);
|
2023-05-16 18:58:13 +10:00
|
|
|
in
|
|
|
|
{
|
2024-03-08 09:51:37 +10:00
|
|
|
darwin01 = darwinSystem {
|
2024-05-15 20:57:38 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.aarch64-darwin;
|
2024-03-08 09:51:37 +10:00
|
|
|
modules = [ ./hosts/darwin01/configuration.nix ];
|
|
|
|
};
|
2023-05-16 18:58:13 +10:00
|
|
|
darwin02 = darwinSystem {
|
2024-04-04 16:09:27 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.aarch64-darwin;
|
2023-05-16 18:58:13 +10:00
|
|
|
modules = [ ./hosts/darwin02/configuration.nix ];
|
|
|
|
};
|
2023-07-17 09:37:43 +10:00
|
|
|
darwin03 = darwinSystem {
|
2024-05-15 20:57:38 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.aarch64-darwin;
|
2023-07-17 09:37:43 +10:00
|
|
|
modules = [ ./hosts/darwin03/configuration.nix ];
|
|
|
|
};
|
2023-05-16 18:58:13 +10:00
|
|
|
};
|
|
|
|
|
2023-05-16 06:54:11 +10:00
|
|
|
flake.nixosConfigurations =
|
|
|
|
let
|
2024-05-27 10:48:18 +10:00
|
|
|
nixosSystem = args:
|
|
|
|
inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args);
|
2023-05-16 06:54:11 +10:00
|
|
|
in
|
|
|
|
{
|
|
|
|
build01 = nixosSystem {
|
2023-07-20 17:11:40 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
2023-05-18 13:24:26 +10:00
|
|
|
modules = [ ./hosts/build01/configuration.nix ];
|
2023-05-16 06:54:11 +10:00
|
|
|
};
|
|
|
|
build02 = nixosSystem {
|
2023-07-20 17:11:40 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
2023-05-18 13:24:26 +10:00
|
|
|
modules = [ ./hosts/build02/configuration.nix ];
|
2023-05-16 06:54:11 +10:00
|
|
|
};
|
|
|
|
build03 = nixosSystem {
|
2023-07-20 17:11:40 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
2023-05-18 13:24:26 +10:00
|
|
|
modules = [ ./hosts/build03/configuration.nix ];
|
2023-05-16 06:54:11 +10:00
|
|
|
};
|
|
|
|
build04 = nixosSystem {
|
2023-07-20 17:11:40 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.aarch64-linux;
|
2023-05-18 13:24:26 +10:00
|
|
|
modules = [ ./hosts/build04/configuration.nix ];
|
2023-05-16 06:54:11 +10:00
|
|
|
};
|
2023-07-22 09:50:53 +10:00
|
|
|
web02 = nixosSystem {
|
2023-07-20 17:11:40 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
2023-07-22 09:50:53 +10:00
|
|
|
modules = [ ./hosts/web02/configuration.nix ];
|
|
|
|
};
|
2023-05-16 06:54:11 +10:00
|
|
|
};
|
2023-05-16 09:53:27 +10:00
|
|
|
|
2023-07-17 13:53:06 +10:00
|
|
|
flake.darwinModules = {
|
|
|
|
common = ./modules/darwin/common;
|
|
|
|
|
2023-09-07 12:47:33 +10:00
|
|
|
builder = ./modules/darwin/builder.nix;
|
2023-10-27 13:42:58 +10:00
|
|
|
community-builder = ./modules/darwin/community-builder;
|
2023-07-17 13:53:06 +10:00
|
|
|
hercules-ci = ./modules/darwin/hercules-ci;
|
2023-09-06 10:14:00 +10:00
|
|
|
remote-builder = ./modules/darwin/remote-builder.nix;
|
2023-07-17 13:53:06 +10:00
|
|
|
};
|
|
|
|
|
2023-05-17 07:21:20 +10:00
|
|
|
flake.nixosModules = {
|
2023-07-02 08:16:12 +10:00
|
|
|
common = ./modules/nixos/common;
|
2023-05-17 07:21:20 +10:00
|
|
|
|
2023-11-21 09:33:18 +10:00
|
|
|
buildbot = ./modules/nixos/buildbot.nix;
|
2023-09-07 12:47:33 +10:00
|
|
|
builder = ./modules/nixos/builder.nix;
|
2023-07-01 13:32:28 +10:00
|
|
|
community-builder = ./modules/nixos/community-builder;
|
2023-12-07 09:42:53 +10:00
|
|
|
disko-raid = ./modules/nixos/disko-raid.nix;
|
2024-04-07 08:14:55 +10:00
|
|
|
disko-zfs = ./modules/nixos/disko-zfs.nix;
|
2023-05-07 10:24:44 +10:00
|
|
|
github-org-backup = ./modules/nixos/github-org-backup.nix;
|
2023-05-17 07:21:20 +10:00
|
|
|
hercules-ci = ./modules/nixos/hercules-ci;
|
2023-07-01 13:33:11 +10:00
|
|
|
hydra = ./modules/nixos/hydra.nix;
|
2023-07-21 20:18:58 +10:00
|
|
|
monitoring = ./modules/nixos/monitoring;
|
2023-07-01 13:33:11 +10:00
|
|
|
nur-update = ./modules/nixos/nur-update.nix;
|
2023-09-24 08:57:55 +10:00
|
|
|
remote-builder = ./modules/nixos/remote-builder.nix;
|
2023-11-16 20:41:39 +10:00
|
|
|
watch-store = ./modules/nixos/watch-store.nix;
|
2023-05-17 07:21:20 +10:00
|
|
|
};
|
2022-09-07 17:47:16 +02:00
|
|
|
};
|
2022-04-10 20:57:52 +02:00
|
|
|
}
|