mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-03-14 20:56:48 +00:00
dev: Use hercules-ci-effects.flakeModule
This commit is contained in:
parent
39a134713e
commit
8fe43d231b
2 changed files with 10 additions and 11 deletions
|
@ -1,8 +1,9 @@
|
||||||
{ config, lib, inputs, ... }:
|
{ config, lib, inputs, withSystem, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.pre-commit-hooks-nix.flakeModule
|
inputs.pre-commit-hooks-nix.flakeModule
|
||||||
|
inputs.hercules-ci-effects.flakeModule
|
||||||
../site/flake-module.nix
|
../site/flake-module.nix
|
||||||
];
|
];
|
||||||
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
||||||
|
@ -30,23 +31,21 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
flake = {
|
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; };
|
options.herculesCI = lib.mkOption { type = lib.types.raw; };
|
||||||
config.herculesCI = { branch, ... }: {
|
config.herculesCI = { branch, ... }: {
|
||||||
onPush.default.outputs = {
|
onPush.default.outputs = {
|
||||||
inherit (config.flake) packages checks;
|
inherit (config.flake) packages checks;
|
||||||
effects =
|
effects =
|
||||||
let
|
withSystem "x86_64-linux" ({ config, pkgs, effects, ... }: {
|
||||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
|
||||||
effects = inputs.hercules-ci-effects.lib.withPkgs pkgs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
netlifyDeploy = effects.netlifyDeploy {
|
netlifyDeploy = effects.netlifyDeploy {
|
||||||
content = config.flake.packages.x86_64-linux.siteContent;
|
content = config.packages.siteContent;
|
||||||
secretName = "default-netlify";
|
secretName = "default-netlify";
|
||||||
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
|
siteId = "29a153b1-3698-433c-bc73-62415efb8117";
|
||||||
productionDeployment = branch == "main";
|
productionDeployment = branch == "main";
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
6
dev/flake.lock
generated
6
dev/flake.lock
generated
|
@ -20,11 +20,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1653487348,
|
"lastModified": 1653740649,
|
||||||
"narHash": "sha256-lWqxXMRqO8blpwhH2qvrFBVp6aZ7V+Z3xTqkNWKyLQw=",
|
"narHash": "sha256-3kZc+D03J+Uleftpdv5BuBogwkc45zvhDte/AI0BvaI=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "hercules-ci-effects",
|
"repo": "hercules-ci-effects",
|
||||||
"rev": "0ab66b56d3f2b40ddfd981899d1757773632075f",
|
"rev": "6d99ef9727b1327ec7eb6fa2055b74bd88ea4709",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue