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 = {
|
2022-12-12 07:18:12 +10:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
flake-parts.inputs.nixpkgs-lib.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 = "";
|
2022-12-19 15:59:28 +01:00
|
|
|
srvos.url = "github:numtide/srvos";
|
|
|
|
# actually not used when using the modules but than nothing ever will try to fetch this nixpkgs variant
|
|
|
|
srvos.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2022-12-12 07:18:12 +10:00
|
|
|
nixpkgs-update.url = "github:ryantm/nixpkgs-update";
|
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
|
|
|
|
2023-03-10 22:48:15 +10:00
|
|
|
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
|
|
|
|
hercules-ci-effects.inputs.flake-parts.follows = "flake-parts";
|
|
|
|
hercules-ci-effects.inputs.hercules-ci-agent.follows = "";
|
|
|
|
hercules-ci-effects.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";
|
2022-04-10 20:57:52 +02:00
|
|
|
};
|
|
|
|
|
2023-04-06 11:49:28 +10:00
|
|
|
outputs = inputs @ { flake-parts, self, ... }:
|
2022-09-07 17:47:16 +02:00
|
|
|
flake-parts.lib.mkFlake
|
2022-12-31 07:24:17 +01:00
|
|
|
{ inherit inputs; }
|
2022-08-29 14:11:38 +02:00
|
|
|
{
|
2022-12-31 07:24:17 +01:00
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2022-04-10 20:57:52 +02:00
|
|
|
|
2023-04-06 11:49:28 +10:00
|
|
|
herculesCI = { lib, ... }: {
|
|
|
|
ciSystems = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
|
|
|
|
onPush.default.outputs = {
|
|
|
|
checks = lib.mkForce self.outputs.checks.x86_64-linux;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-05-02 18:35:18 +10:00
|
|
|
hercules-ci.flake-update = {
|
|
|
|
enable = true;
|
|
|
|
createPullRequest = true;
|
|
|
|
autoMergeMethod = "rebase";
|
|
|
|
when = {
|
|
|
|
hour = [ 2 ];
|
|
|
|
dayOfWeek = [ "Mon" "Fri" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-12-31 07:18:49 +01:00
|
|
|
imports = [
|
2023-04-06 11:49:28 +10:00
|
|
|
inputs.hercules-ci-effects.flakeModule
|
2023-04-06 11:41:44 +10:00
|
|
|
inputs.treefmt-nix.flakeModule
|
2023-04-06 11:49:28 +10:00
|
|
|
./effect.nix
|
2023-04-06 11:41:44 +10:00
|
|
|
./shell.nix
|
2022-12-31 07:18:49 +01:00
|
|
|
];
|
|
|
|
|
2023-04-26 16:19:18 +10:00
|
|
|
hercules-ci.github-pages.branch = "master";
|
|
|
|
|
|
|
|
perSystem = { config, pkgs, ... }: {
|
|
|
|
treefmt.imports = [ ./treefmt.nix ];
|
|
|
|
|
|
|
|
packages.pages = pkgs.runCommand "pages"
|
|
|
|
{
|
|
|
|
buildInputs = [ pkgs.python3.pkgs.mkdocs-material ];
|
|
|
|
} ''
|
|
|
|
cp -r ${pkgs.lib.cleanSource ./.}/* .
|
|
|
|
mkdocs build --strict --site-dir $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
hercules-ci.github-pages.settings.contents = config.packages.pages;
|
|
|
|
};
|
2023-04-12 10:15:26 +02:00
|
|
|
|
2022-12-31 07:24:17 +01:00
|
|
|
flake.nixosConfigurations =
|
|
|
|
let
|
|
|
|
inherit (inputs.nixpkgs.lib) nixosSystem;
|
|
|
|
common = [
|
|
|
|
{ _module.args.inputs = inputs; }
|
2023-01-02 09:44:59 +01:00
|
|
|
{ srvos.flake = inputs.self; }
|
2022-12-31 07:24:17 +01:00
|
|
|
inputs.sops-nix.nixosModules.sops
|
|
|
|
inputs.srvos.nixosModules.server
|
2022-12-19 21:49:24 +01:00
|
|
|
|
2023-01-01 17:04:38 +01:00
|
|
|
inputs.srvos.nixosModules.mixins-telegraf
|
2022-12-31 07:24:17 +01:00
|
|
|
{ networking.firewall.allowedTCPPorts = [ 9273 ]; }
|
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
2023-02-06 18:09:06 +10:00
|
|
|
build01 = nixosSystem {
|
2022-12-31 07:24:17 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules =
|
|
|
|
common
|
|
|
|
++ [
|
|
|
|
./build01/configuration.nix
|
2023-01-01 17:04:38 +01:00
|
|
|
inputs.srvos.nixosModules.hardware-hetzner-online-amd
|
2022-12-31 07:24:17 +01:00
|
|
|
];
|
|
|
|
};
|
2022-04-10 20:57:52 +02:00
|
|
|
|
2023-02-06 18:09:06 +10:00
|
|
|
build02 = nixosSystem {
|
2022-12-31 07:24:17 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules =
|
|
|
|
common
|
|
|
|
++ [
|
|
|
|
./build02/configuration.nix
|
2023-01-01 17:04:38 +01:00
|
|
|
inputs.srvos.nixosModules.mixins-nginx
|
|
|
|
inputs.srvos.nixosModules.hardware-hetzner-online-amd
|
2022-12-31 07:24:17 +01:00
|
|
|
];
|
|
|
|
};
|
2022-04-10 22:08:57 +02:00
|
|
|
|
2023-02-06 18:09:06 +10:00
|
|
|
build03 = nixosSystem {
|
2022-12-31 07:24:17 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules =
|
|
|
|
common
|
|
|
|
++ [
|
|
|
|
./build03/configuration.nix
|
2023-01-01 17:04:38 +01:00
|
|
|
inputs.srvos.nixosModules.mixins-nginx
|
|
|
|
inputs.srvos.nixosModules.hardware-hetzner-online-amd
|
2022-12-31 07:24:17 +01:00
|
|
|
];
|
|
|
|
};
|
2022-08-29 14:11:38 +02:00
|
|
|
|
2023-02-06 18:09:06 +10:00
|
|
|
build04 = nixosSystem {
|
2022-12-31 07:24:17 +01:00
|
|
|
system = "aarch64-linux";
|
|
|
|
modules =
|
|
|
|
common
|
|
|
|
++ [
|
|
|
|
./build04/configuration.nix
|
|
|
|
inputs.disko.nixosModules.disko
|
|
|
|
];
|
|
|
|
};
|
2022-08-29 14:11:38 +02:00
|
|
|
};
|
2022-09-07 17:47:16 +02:00
|
|
|
};
|
2022-04-10 20:57:52 +02:00
|
|
|
}
|