1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

Use flakeModule based automatic herculesCI.onPush

This commit is contained in:
Robert Hensing 2022-11-11 08:00:22 +01:00
parent d8f05073ae
commit 45fc384fe3
2 changed files with 14 additions and 18 deletions

View file

@ -4,6 +4,7 @@ let
self = {
inherit (flake) inputs;
outPath = ../.; # used by pre-commit module, etc
outputs = self.config.flake;
} //
fmc-lib.evalFlakeModule
{ inherit self; }

View file

@ -30,25 +30,20 @@
};
};
flake = {
# Because of ./README.md, we can't use the built-in flake support, including
# the `effects` flake attribute. We have to define `herculesCI` ourselves.
options.herculesCI = lib.mkOption { type = lib.types.raw; };
config.herculesCI = { branch, ... }: {
herculesCI = herculesCI@{ config, ... }: {
onPush.default.outputs = {
inherit (config.flake) packages checks;
effects =
withSystem "x86_64-linux" ({ config, pkgs, effects, ... }: {
netlifyDeploy = effects.netlifyDeploy {
content = config.packages.siteContent;
secretName = "default-netlify";
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
productionDeployment = branch == "main";
productionDeployment = herculesCI.config.repo.branch == "main";
};
});
};
};
flake = {
# for repl exploration / debug
config.config = config;
options.mySystem = lib.mkOption { default = config.allSystems.${builtins.currentSystem}; };