infra/flake.nix

106 lines
3.2 KiB
Nix
Raw Normal View History

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";
sops-nix.inputs.nixpkgs-stable.follows = "";
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;
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
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";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
2022-04-10 20:57:52 +02:00
};
outputs = inputs @ { flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
herculesCI = { lib, ... }: {
ciSystems = [ "x86_64-linux" "aarch64-linux" ];
onPush.default.outputs = {
checks = lib.mkForce self.outputs.checks.x86_64-linux;
};
};
hercules-ci.flake-update = {
enable = true;
createPullRequest = true;
autoMergeMethod = "rebase";
when = {
hour = [ 2 ];
dayOfWeek = [ "Mon" "Thu" ];
2023-05-02 18:35:18 +10:00
};
};
2023-05-02 18:35:18 +10:00
hercules-ci.github-pages.branch = "master";
2022-12-31 07:18:49 +01:00
imports = [
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
./effect.nix
./shell.nix
./build01
./build02
./build03
./build04
];
2023-04-26 16:19:18 +10:00
perSystem = { config, pkgs, ... }: {
treefmt.imports = [ ./treefmt.nix ];
2023-04-26 16:19:18 +10:00
packages.pages = pkgs.runCommand "pages"
{
buildInputs = [ pkgs.python3.pkgs.mkdocs-material ];
} ''
cp -r ${pkgs.lib.cleanSource ./.}/* .
mkdocs build --strict --site-dir $out
'';
2023-04-26 16:19:18 +10:00
hercules-ci.github-pages.settings.contents = config.packages.pages;
};
flake.lib.nixosSystem = args:
inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args);
flake.nixosModules = {
common = ./roles/common.nix;
};
};
2022-04-10 20:57:52 +02:00
}