2022-05-28 13:18:06 +02:00
|
|
|
{ config, lib, inputs, withSystem, ... }:
|
2022-05-13 10:10:42 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
2022-05-17 10:18:59 +02:00
|
|
|
inputs.pre-commit-hooks-nix.flakeModule
|
2022-05-28 13:18:06 +02:00
|
|
|
inputs.hercules-ci-effects.flakeModule
|
2022-05-18 00:41:17 +02:00
|
|
|
../site/flake-module.nix
|
2022-05-13 10:10:42 +02:00
|
|
|
];
|
|
|
|
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
2022-05-25 18:09:17 +02:00
|
|
|
perSystem = { config, self', inputs', pkgs, ... }: {
|
2022-05-17 10:18:59 +02:00
|
|
|
|
2022-05-13 10:10:42 +02:00
|
|
|
devShells.default = pkgs.mkShell {
|
2022-05-17 10:18:59 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.nixpkgs-fmt
|
|
|
|
pkgs.pre-commit
|
2022-05-18 00:41:17 +02:00
|
|
|
pkgs.hci
|
|
|
|
pkgs.netlify-cli
|
|
|
|
pkgs.pandoc
|
2022-05-17 10:18:59 +02:00
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
${config.pre-commit.installationScript}
|
|
|
|
'';
|
2022-05-13 10:10:42 +02:00
|
|
|
};
|
2022-05-18 11:03:42 +02:00
|
|
|
|
2022-05-17 10:18:59 +02:00
|
|
|
pre-commit = {
|
|
|
|
inherit pkgs; # should make this default to the one it can get via follows
|
|
|
|
settings = {
|
2022-05-17 10:28:03 +02:00
|
|
|
hooks.nixpkgs-fmt.enable = true;
|
2022-05-17 10:18:59 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-05-13 10:10:42 +02:00
|
|
|
};
|
|
|
|
flake = {
|
2022-05-28 13:18:06 +02:00
|
|
|
# Because of ./README.md, we can't use the built-in flake support, including
|
|
|
|
# the `effects` flake attribute. We have to define `herculesCI` ourselves.
|
2022-05-13 10:10:42 +02:00
|
|
|
options.herculesCI = lib.mkOption { type = lib.types.raw; };
|
2022-05-18 00:41:17 +02:00
|
|
|
config.herculesCI = { branch, ... }: {
|
2022-05-17 10:28:03 +02:00
|
|
|
onPush.default.outputs = {
|
2022-05-13 10:10:42 +02:00
|
|
|
inherit (config.flake) packages checks;
|
2022-05-18 00:41:17 +02:00
|
|
|
effects =
|
2022-05-28 13:18:06 +02:00
|
|
|
withSystem "x86_64-linux" ({ config, pkgs, effects, ... }: {
|
2022-05-28 12:48:07 +02:00
|
|
|
netlifyDeploy = effects.netlifyDeploy {
|
2022-05-28 13:18:06 +02:00
|
|
|
content = config.packages.siteContent;
|
2022-05-18 00:41:17 +02:00
|
|
|
secretName = "default-netlify";
|
|
|
|
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
|
2022-05-28 12:48:07 +02:00
|
|
|
productionDeployment = branch == "main";
|
|
|
|
};
|
2022-05-28 13:18:06 +02:00
|
|
|
});
|
2022-05-13 10:10:42 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# for repl exploration / debug
|
|
|
|
config.config = config;
|
|
|
|
options.mySystem = lib.mkOption { default = config.allSystems.${builtins.currentSystem}; };
|
|
|
|
};
|
|
|
|
}
|