1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-16 21:38:24 +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 = { self = {
inherit (flake) inputs; inherit (flake) inputs;
outPath = ../.; # used by pre-commit module, etc outPath = ../.; # used by pre-commit module, etc
outputs = self.config.flake;
} // } //
fmc-lib.evalFlakeModule fmc-lib.evalFlakeModule
{ inherit self; } { inherit self; }

View file

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