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"
|
|
|
|
"https://nixpkgs-update.cachix.org"
|
|
|
|
];
|
|
|
|
nixConfig.extra-trusted-public-keys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8="
|
|
|
|
];
|
|
|
|
|
2022-04-10 20:57:52 +02:00
|
|
|
inputs = {
|
2023-10-23 10:56:07 +10:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2022-12-12 07:18:12 +10:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
2023-07-15 10:39:08 +10:00
|
|
|
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
2022-04-10 20:57:52 +02:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
2022-09-25 07:27:35 +10:00
|
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
2023-03-20 13:22:34 +10:00
|
|
|
sops-nix.inputs.nixpkgs-stable.follows = "";
|
2023-11-03 20:51:16 +10:00
|
|
|
srvos.url = "github:nix-community/srvos";
|
2022-12-19 15:59:28 +01:00
|
|
|
# actually not used when using the modules but than nothing ever will try to fetch this nixpkgs variant
|
|
|
|
srvos.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2023-10-30 08:23:27 +10:00
|
|
|
nixpkgs-update.url = "github:qowoz/nixpkgs-update/wait60";
|
2023-01-15 23:47:28 +01:00
|
|
|
nixpkgs-update.inputs.mmdoc.follows = "";
|
2022-12-12 07:18:12 +10:00
|
|
|
nixpkgs-update-github-releases.url = "github:ryantm/nixpkgs-update-github-releases";
|
|
|
|
nixpkgs-update-github-releases.flake = false;
|
2022-12-12 07:41:32 +10:00
|
|
|
|
|
|
|
nur-update.url = "github:nix-community/nur-update";
|
|
|
|
nur-update.inputs.nixpkgs.follows = "nixpkgs";
|
2022-12-30 20:49:32 +01:00
|
|
|
|
|
|
|
disko.url = "github:nix-community/disko";
|
|
|
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
2022-12-31 07:18:49 +01:00
|
|
|
|
|
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
2023-02-06 14:42:30 +10:00
|
|
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
2023-05-19 23:51:43 +10:00
|
|
|
|
2023-10-16 13:09:29 +10:00
|
|
|
tf-pkgs.url = "github:NixOS/nixpkgs/982b24c40e743793c966b47b3bb3699881489ae0";
|
2023-10-27 14:41:03 +10:00
|
|
|
|
|
|
|
hercules-ci-agent.url = "github:hercules-ci/hercules-ci-agent";
|
|
|
|
hercules-ci-agent.inputs.flake-parts.follows = "flake-parts";
|
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; }
|
|
|
|
{
|
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
];
|
2022-12-31 07:18:49 +01:00
|
|
|
|
2023-09-13 11:35:21 +10:00
|
|
|
perSystem = { config, pkgs, ... }:
|
|
|
|
let
|
|
|
|
defaultPlatform = pkgs.stdenv.hostPlatform.system == "x86_64-linux";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./dev/shell.nix
|
|
|
|
./terraform/shell.nix
|
|
|
|
];
|
|
|
|
treefmt = {
|
|
|
|
flakeCheck = defaultPlatform;
|
|
|
|
imports = [ ./dev/treefmt.nix ];
|
|
|
|
};
|
|
|
|
|
|
|
|
checks = pkgs.lib.optionalAttrs defaultPlatform {
|
2023-10-29 13:55:27 +10:00
|
|
|
nixosTests-buildbot = pkgs.nixosTests.buildbot;
|
2023-09-13 11:35:21 +10:00
|
|
|
nixosTests-hydra = pkgs.nixosTests.hydra.hydra_unstable;
|
2023-10-26 18:03:00 +10:00
|
|
|
#nixosTests-lemmy = pkgs.nixosTests.lemmy;
|
2023-09-13 11:35:21 +10:00
|
|
|
nixosTests-pict-rs = pkgs.nixosTests.pict-rs;
|
|
|
|
};
|
2023-04-26 16:19:18 +10:00
|
|
|
|
2023-09-15 11:17:28 +10:00
|
|
|
packages = pkgs.lib.optionalAttrs defaultPlatform {
|
2023-09-15 14:43:04 +10:00
|
|
|
cachix-deploy-spec = pkgs.writeText "cachix-deploy.json" (builtins.toJSON {
|
2023-10-30 10:23:51 +10:00
|
|
|
agents = {
|
|
|
|
# hercules-ci-agent IFD breaks darwin02
|
|
|
|
darwin03 = builtins.unsafeDiscardStringContext self.darwinConfigurations.darwin03.config.system.build.toplevel;
|
|
|
|
};
|
2023-09-15 14:43:04 +10:00
|
|
|
});
|
2023-09-15 11:17:28 +10:00
|
|
|
pages = pkgs.runCommand "pages"
|
|
|
|
{
|
|
|
|
buildInputs = [ config.devShells.mkdocs.nativeBuildInputs ];
|
|
|
|
} ''
|
|
|
|
cd ${self}
|
|
|
|
mkdocs build --strict --site-dir $out
|
|
|
|
'';
|
|
|
|
};
|
2023-07-14 17:11:27 +10:00
|
|
|
};
|
|
|
|
|
2023-05-16 18:58:13 +10:00
|
|
|
flake.darwinConfigurations =
|
|
|
|
let
|
2023-06-05 15:34:12 +10:00
|
|
|
inherit (self.lib) darwinSystem;
|
2023-05-16 18:58:13 +10:00
|
|
|
in
|
|
|
|
{
|
|
|
|
darwin02 = darwinSystem {
|
2023-07-20 17:11:40 +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 {
|
2023-07-20 17:11:40 +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
|
2023-05-16 09:53:27 +10:00
|
|
|
inherit (self.lib) nixosSystem;
|
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-04 16:55:32 +12:00
|
|
|
web01 = nixosSystem {
|
2023-07-20 17:11:40 +10:00
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
2023-07-04 16:55:32 +12:00
|
|
|
modules = [ ./hosts/web01/configuration.nix ];
|
|
|
|
};
|
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-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-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;
|
|
|
|
remote-workers = ./modules/nixos/remote-workers.nix;
|
2023-07-01 20:28:31 +10:00
|
|
|
watch-store = ./modules/nixos/cachix/watch-store.nix;
|
2023-05-17 07:21:20 +10:00
|
|
|
zfs = ./modules/nixos/zfs.nix;
|
|
|
|
};
|
|
|
|
|
2023-06-05 15:34:12 +10:00
|
|
|
flake.lib.darwinSystem = args:
|
2023-07-15 10:39:08 +10:00
|
|
|
inputs.nix-darwin.lib.darwinSystem ({ specialArgs = { inherit inputs; }; } // args);
|
2023-05-16 09:53:27 +10:00
|
|
|
flake.lib.nixosSystem = args:
|
|
|
|
inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args);
|
2022-09-07 17:47:16 +02:00
|
|
|
};
|
2022-04-10 20:57:52 +02:00
|
|
|
}
|