2024-11-13 22:41:34 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-11-26 12:59:21 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
2024-11-13 22:41:34 +01:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
git-hooks.url = "github:cachix/git-hooks.nix";
|
2024-12-11 13:25:31 +01:00
|
|
|
agenix.url = "github:ryantm/agenix";
|
2024-11-13 22:59:51 +01:00
|
|
|
|
|
|
|
disko.url = "github:nix-community/disko";
|
|
|
|
|
|
|
|
nixops4.url = "github:nixops4/nixops4";
|
|
|
|
nixops4-nixos.url = "github:nixops4/nixops4/eval";
|
2024-11-13 22:41:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
inputs@{ flake-parts, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
|
|
|
|
2024-11-14 01:10:00 +01:00
|
|
|
imports = [
|
|
|
|
inputs.git-hooks.flakeModule
|
2024-11-13 22:59:51 +01:00
|
|
|
inputs.nixops4-nixos.modules.flake.default
|
2024-11-14 01:10:00 +01:00
|
|
|
|
2024-11-13 22:59:51 +01:00
|
|
|
./deployment/flake-part.nix
|
2024-11-17 01:02:23 +01:00
|
|
|
./infra/flake-part.nix
|
2024-12-12 11:05:11 +01:00
|
|
|
./keys/flake-part.nix
|
2024-11-14 01:10:00 +01:00
|
|
|
./services/flake-part.nix
|
2024-12-12 11:05:11 +01:00
|
|
|
./secrets/flake-part.nix
|
2024-11-14 01:10:00 +01:00
|
|
|
];
|
2024-11-13 22:41:34 +01:00
|
|
|
|
|
|
|
perSystem =
|
2024-11-13 22:59:51 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
inputs',
|
|
|
|
...
|
|
|
|
}:
|
2024-11-13 22:41:34 +01:00
|
|
|
{
|
|
|
|
formatter = pkgs.nixfmt-rfc-style;
|
|
|
|
|
|
|
|
pre-commit.settings.hooks =
|
|
|
|
## Not everybody might want pre-commit hooks, so we make them
|
|
|
|
## opt-in. Maybe one day we will decide to have them everywhere.
|
|
|
|
let
|
|
|
|
inherit (builtins) concatStringsSep;
|
2024-11-14 09:49:49 +01:00
|
|
|
optin = [
|
|
|
|
"deployment"
|
2024-11-18 12:09:30 +01:00
|
|
|
"infra"
|
2024-12-12 10:39:49 +01:00
|
|
|
"keys"
|
2024-12-11 13:26:38 +01:00
|
|
|
"secrets"
|
2024-11-14 09:49:49 +01:00
|
|
|
"services"
|
|
|
|
];
|
2024-11-13 22:41:34 +01:00
|
|
|
files = "^((" + concatStringsSep "|" optin + ")/.*\\.nix|[^/]*\\.nix)$";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
nixfmt-rfc-style = {
|
|
|
|
enable = true;
|
|
|
|
inherit files;
|
|
|
|
};
|
|
|
|
deadnix = {
|
|
|
|
enable = true;
|
|
|
|
inherit files;
|
|
|
|
};
|
2024-11-20 13:07:03 +01:00
|
|
|
trim-trailing-whitespace = {
|
|
|
|
enable = true;
|
|
|
|
inherit files;
|
|
|
|
};
|
2024-11-13 22:41:34 +01:00
|
|
|
};
|
|
|
|
|
2024-11-14 01:10:00 +01:00
|
|
|
devShells.default = pkgs.mkShell {
|
2024-11-13 22:59:51 +01:00
|
|
|
packages = [
|
|
|
|
pkgs.nil
|
2024-12-11 13:25:31 +01:00
|
|
|
inputs'.agenix.packages.default
|
2024-11-13 22:59:51 +01:00
|
|
|
inputs'.nixops4.packages.default
|
|
|
|
];
|
2024-11-14 01:10:00 +01:00
|
|
|
shellHook = config.pre-commit.installationScript;
|
|
|
|
};
|
2024-11-13 22:41:34 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|