diff options
| author | seth <[email protected]> | 2023-05-22 02:35:15 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-05-23 11:05:28 -0400 |
| commit | 630934a2631d9429b4e46c1b6ec0f6640f332384 (patch) | |
| tree | d8bd14cafb0ac382625bc5dca79b84d497e9bab7 /modules/flake | |
| parent | 2cb6cfab9553184c1e6a10303cb832fe96080d00 (diff) | |
!hercules-ci -> hydra
Diffstat (limited to 'modules/flake')
| -rw-r--r-- | modules/flake/ci.nix | 67 | ||||
| -rw-r--r-- | modules/flake/default.nix | 15 | ||||
| -rw-r--r-- | modules/flake/dev.nix | 14 |
3 files changed, 37 insertions, 59 deletions
diff --git a/modules/flake/ci.nix b/modules/flake/ci.nix index 91dc397..9f4e58d 100644 --- a/modules/flake/ci.nix +++ b/modules/flake/ci.nix @@ -1,56 +1,23 @@ { + myLib, 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; +}: { + flake = { + hydraJobs = let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + in + with (myLib.my.ci supportedSystems); { + apps = mkCompatibleApps self.apps; + checks = mkCompatible self.checks; + devShells = mkCompatible self.devShells; + formatter = mkCompatibleFormatters self.formatter; + homeConfigurations = mkCompatibleHM self.homeConfigurations; + packages = mkCompatiblePkgs self.packages; + hosts = mkCompatibleCfg self.nixosConfigurations; }; - }; - }; - - 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); - }; - }; }; } diff --git a/modules/flake/default.nix b/modules/flake/default.nix index 29c6c63..655ca47 100644 --- a/modules/flake/default.nix +++ b/modules/flake/default.nix @@ -1,9 +1,22 @@ -_: { +{ + inputs, + self, + ... +}: { imports = [ ./ci.nix ./dev.nix ]; + _module.args.myLib = self.lib { + inherit inputs; + inherit (inputs.nixpkgs) lib; + }; + + flake = { + lib = import ../../lib; + }; + systems = [ "x86_64-linux" "aarch64-linux" diff --git a/modules/flake/dev.nix b/modules/flake/dev.nix index 089c77a..6543fdd 100644 --- a/modules/flake/dev.nix +++ b/modules/flake/dev.nix @@ -1,18 +1,16 @@ { - self, inputs, + self, ... -}: let - inherit (inputs) pre-commit-hooks ragenix; -in { +}: { perSystem = { pkgs, system, ... }: { checks = { - pre-commit-check = pre-commit-hooks.lib.${system}.run { - src = ./..; + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; hooks = { actionlint.enable = true; alejandra.enable = true; @@ -29,12 +27,12 @@ in { in { default = mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; - packages = with pkgs; [ + packages = with pkgs; + with inputs; [ actionlint alejandra deadnix just - nil ragenix.packages.${system}.ragenix statix stylua |
