From 8de02080824a3b56fa410f6cc187936ed0a64349 Mon Sep 17 00:00:00 2001 From: Hugh Davidson Date: Tue, 5 Mar 2024 12:13:49 +1100 Subject: [PATCH] feat: add hydra spec --- .hydra/spec.json | 14 ++++++++++++++ flake.nix | 38 ++++++++++++++++++++++++++------------ package-lock.json | 6 ++++++ 3 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 .hydra/spec.json create mode 100644 package-lock.json diff --git a/.hydra/spec.json b/.hydra/spec.json new file mode 100644 index 0000000..a44b02b --- /dev/null +++ b/.hydra/spec.json @@ -0,0 +1,14 @@ +{ + "wai-handler-hal-example": { + "enabled": 1, + "hidden": false, + "keepnr": 1, + "checkinterval": 300, + "schedulingshares": 100, + "description": "Development shell and bootstraps for wai-handler-hal-example repo", + "enableemail": false, + "emailoverride": "", + "type": 1, + "flake": "git+ssh://git@github.com/bellroy/wai-handler-hal-example" + } +} diff --git a/flake.nix b/flake.nix index 0b13482..c0a129e 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,16 @@ }]; }; + devShells.x86_64-linux.default = + (project pkgsLocal).shellFor { + withHoogle = false; + buildInputs = with pkgsLocal; [ + haskellPackages.cabal-fmt + nixpkgs-fmt + nodejs + ]; + }; + # Compress a binary and put it in a directory under the name # `bootstrap`; CDK is smart enough to zip the directory up for # deployment. @@ -47,8 +57,7 @@ mkdir $out ${pkgsLocal.upx}/bin/upx -9 -o $out/bootstrap ${lambdaBinary} ''; - in - { + packages.x86_64-linux = { default = bootstrap; container = pkgsLocal.callPackage ./container.nix { @@ -66,16 +75,21 @@ }; }; - devShells.x86_64-linux.default = - (project pkgsLocal).shellFor { - withHoogle = false; - buildInputs = with pkgsLocal; [ - haskellPackages.cabal-fmt - nixpkgs-fmt - nodejs - ]; - }; - }; + hydraJobs = { + aggregate = evalPkgs.runCommand "aggregate" + { + _hydraAggregate = true; + constituents = [ + "devShells.x86_64-linux.default" + "packages.x86_64-linux.default" + "packages.x86_64-linux.container" + "packages.x86_64-linux.tiny-container" + ]; + } + "touch $out"; + } // devShells // packages; + in + { inherit devShells packages hydraJobs; }; nixConfig = { allow-import-from-derivation = "true"; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..cc83e30 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "wai-handler-hal-example", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}