diff options
| author | seth <[email protected]> | 2023-05-03 21:11:47 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-05-03 21:11:47 -0400 |
| commit | cf5647129499df68ac092b55b71a3cddc3422d01 (patch) | |
| tree | f7685c8540cbab2bc51f87a2e9cda214d7d2dfae /flake/ci.nix | |
| parent | cdfc4ba1b2ef2b187e076a6f627e4631b6bd7fb3 (diff) | |
refactor flake + make virtualisation compatible with 22.11
Diffstat (limited to 'flake/ci.nix')
| -rw-r--r-- | flake/ci.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/flake/ci.nix b/flake/ci.nix new file mode 100644 index 0000000..3959260 --- /dev/null +++ b/flake/ci.nix @@ -0,0 +1,52 @@ +{ + inputs, + self, + ... +}: let + inherit (inputs) hercules-ci-effects nixpkgs; +in { + imports = [ + hercules-ci-effects.flakeModule + ]; + + hercules-ci = { + flake-update = { + enable = true; + when = { + hour = [0]; + minute = 0; + }; + }; + }; + + herculesCI = let + inherit (import (hercules-ci-effects + "/vendor/hercules-ci-agent/default-herculesCI-for-flake.nix")) flakeToOutputs; + in rec { + ciSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + onPush = { + default = { + outputs = with builtins; + with nixpkgs.lib; let + # use defaults, but only evaluate hosts + defaults = + removeAttrs + (flakeToOutputs self { + ciSystems = genAttrs ciSystems (_: {}); + }) + ["nixosConfigurations" "packages"]; + + evaluate = mapAttrs (_: v: + seq + v.config.system.build.toplevel + v._module.args.pkgs.emptyFile) + self.nixosConfigurations; + in + mkForce (defaults // evaluate); + }; + }; + }; +} |
