infra/flake.nix

123 lines
3.9 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
};
2022-12-31 07:24:17 +01:00
outputs = inputs @ { flake-parts, ... }:
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
2022-12-31 07:18:49 +01:00
imports = [
./treefmt.nix
];
2022-12-31 07:24:17 +01:00
perSystem =
{ config
, inputs'
2022-12-31 07:24:17 +01:00
, pkgs
, self'
, ...
}: {
devShells.default = pkgs.callPackage ./shell.nix {
inherit config;
2022-12-31 07:24:17 +01:00
};
2022-08-29 14:11:38 +02:00
};
2022-12-31 07:24:17 +01:00
flake.nixosConfigurations =
let
inherit (inputs.nixpkgs.lib) nixosSystem;
common = [
{ _module.args.inputs = inputs; }
{ 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
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
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
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
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-04-10 20:57:52 +02:00
}