2022-05-25 14:19:43 +00:00
|
|
|
{ config, lib, inputs, ... }:
|
2022-05-13 08:10:42 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
2022-05-17 08:18:59 +00:00
|
|
|
inputs.pre-commit-hooks-nix.flakeModule
|
2022-05-17 22:41:17 +00:00
|
|
|
../site/flake-module.nix
|
2022-05-13 08:10:42 +00:00
|
|
|
];
|
|
|
|
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
|
|
|
perSystem = system: { config, self', inputs', pkgs, ... }: {
|
2022-05-17 08:18:59 +00:00
|
|
|
|
2022-05-13 08:10:42 +00:00
|
|
|
devShells.default = pkgs.mkShell {
|
2022-05-17 08:18:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.nixpkgs-fmt
|
|
|
|
pkgs.pre-commit
|
2022-05-17 22:41:17 +00:00
|
|
|
pkgs.hci
|
|
|
|
pkgs.netlify-cli
|
|
|
|
pkgs.pandoc
|
2022-05-17 08:18:59 +00:00
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
${config.pre-commit.installationScript}
|
|
|
|
'';
|
2022-05-13 08:10:42 +00:00
|
|
|
};
|
2022-05-18 09:03:42 +00:00
|
|
|
|
2022-05-17 08:18:59 +00:00
|
|
|
pre-commit = {
|
|
|
|
inherit pkgs; # should make this default to the one it can get via follows
|
|
|
|
settings = {
|
2022-05-17 08:28:03 +00:00
|
|
|
hooks.nixpkgs-fmt.enable = true;
|
2022-05-17 08:18:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-05-13 08:10:42 +00:00
|
|
|
};
|
|
|
|
flake = {
|
|
|
|
options.herculesCI = lib.mkOption { type = lib.types.raw; };
|
2022-05-17 22:41:17 +00:00
|
|
|
config.herculesCI = { branch, ... }: {
|
2022-05-17 08:28:03 +00:00
|
|
|
onPush.default.outputs = {
|
2022-05-13 08:10:42 +00:00
|
|
|
inherit (config.flake) packages checks;
|
2022-05-17 22:41:17 +00:00
|
|
|
effects =
|
|
|
|
let
|
|
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
effects = inputs.hercules-ci-effects.lib.withPkgs pkgs;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
netlifyDeploy = effects.runIf (branch == "main") (effects.netlifyDeploy {
|
2022-05-25 14:19:43 +00:00
|
|
|
content = config.flake.packages.x86_64-linux.siteContent;
|
2022-05-17 22:41:17 +00:00
|
|
|
secretName = "default-netlify";
|
|
|
|
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
|
|
|
|
productionDeployment = true;
|
|
|
|
});
|
|
|
|
};
|
2022-05-13 08:10:42 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# for repl exploration / debug
|
|
|
|
config.config = config;
|
|
|
|
options.mySystem = lib.mkOption { default = config.allSystems.${builtins.currentSystem}; };
|
|
|
|
};
|
|
|
|
}
|