From 8abb7764f8343fcd730a1fe6bf8d2cb32d43dc79 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 8 May 2023 13:55:26 -0400 Subject: flake: move flake modules to modules/ --- modules/flake/ci.nix | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 modules/flake/ci.nix (limited to 'modules/flake/ci.nix') diff --git a/modules/flake/ci.nix b/modules/flake/ci.nix new file mode 100644 index 0000000..91dc397 --- /dev/null +++ b/modules/flake/ci.nix @@ -0,0 +1,56 @@ +{ + self, + inputs, + ... +}: 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); + }; + }; + }; +} -- cgit v1.2.3