Skip to content

Commit d70b626

Browse files
committed
move herculesCI to its own flake modules
1 parent 62c39fb commit d70b626

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

flake.nix

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
flake-parts.lib.mkFlake { inherit inputs; } (
2222
{
2323
lib,
24-
config,
25-
withSystem,
2624
...
2725
}:
2826
{
@@ -36,21 +34,7 @@
3634
++ inputs.nixpkgs.lib.optional (inputs.treefmt-nix ? flakeModule) ./formatter/flake-module.nix
3735
++ inputs.nixpkgs.lib.optionals (inputs.hercules-ci-effects ? flakeModule) [
3836
inputs.hercules-ci-effects.flakeModule
39-
{
40-
herculesCI = herculesCI: {
41-
onPush.default.outputs.effects.deploy = withSystem config.defaultEffectSystem (
42-
{ pkgs, hci-effects, ... }:
43-
hci-effects.runIf (herculesCI.config.repo.branch == "main") (
44-
hci-effects.mkEffect {
45-
effectScript = ''
46-
echo "${builtins.toJSON { inherit (herculesCI.config.repo) branch tag rev; }}"
47-
${pkgs.hello}/bin/hello
48-
'';
49-
}
50-
)
51-
);
52-
};
53-
}
37+
./herculesCI/flake-module.nix
5438
];
5539
systems = [
5640
"x86_64-linux"

herculesCI/flake-module.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
config,
3+
withSystem,
4+
...
5+
}:
6+
{
7+
herculesCI = herculesCI: {
8+
onPush.default.outputs.effects.deploy = withSystem config.defaultEffectSystem (
9+
{ pkgs, hci-effects, ... }:
10+
hci-effects.runIf (herculesCI.config.repo.branch == "main") (
11+
hci-effects.mkEffect {
12+
effectScript = ''
13+
echo "${builtins.toJSON { inherit (herculesCI.config.repo) branch tag rev; }}"
14+
${pkgs.hello}/bin/hello
15+
'';
16+
}
17+
)
18+
);
19+
};
20+
}

0 commit comments

Comments
 (0)