From 8de02080824a3b56fa410f6cc187936ed0a64349 Mon Sep 17 00:00:00 2001 From: Hugh Davidson Date: Tue, 5 Mar 2024 12:13:49 +1100 Subject: [PATCH 1/4] 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": {} +} From 57309ac215320de7d13e7f73edb4dc0365e72d47 Mon Sep 17 00:00:00 2001 From: Jack Kelly Date: Tue, 5 Mar 2024 11:37:58 +1000 Subject: [PATCH 2/4] hydra: Use correct package set --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index c0a129e..0f06b69 100644 --- a/flake.nix +++ b/flake.nix @@ -76,7 +76,7 @@ }; hydraJobs = { - aggregate = evalPkgs.runCommand "aggregate" + aggregate = pkgsLocal.runCommand "aggregate" { _hydraAggregate = true; constituents = [ From 288c4b9d3f50f4e63520209257680ebe4db79e66 Mon Sep 17 00:00:00 2001 From: Jack Kelly Date: Tue, 5 Mar 2024 11:38:12 +1000 Subject: [PATCH 3/4] Bump GHC version and bounds --- flake.nix | 2 +- wai-handler-hal-example.cabal | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 0f06b69..e34d440 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ pkgsMusl = pkgsLocal.pkgsCross.musl64; project = pkgs: pkgs.haskell-nix.project { - compiler-nix-name = "ghc948"; + compiler-nix-name = "ghc963"; evalSystem = "x86_64-linux"; src = pkgsLocal.haskell-nix.haskellLib.cleanGit { name = "wai-handler-hal-example"; diff --git a/wai-handler-hal-example.cabal b/wai-handler-hal-example.cabal index 43168a0..3859886 100644 --- a/wai-handler-hal-example.cabal +++ b/wai-handler-hal-example.cabal @@ -21,7 +21,7 @@ extra-source-files: README.md tested-with: - GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.5 || ==9.4.5 + GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.5 || ==9.4.5 || ==9.6.3 common opts default-language: Haskell2010 @@ -35,7 +35,7 @@ common opts common deps build-depends: , aeson >=1.5.6.0 && <1.6 || >=2.0 && <2.3 - , base >=4.12 && <4.19 + , base >=4.12 && <4.20 , servant >=0.18.2 && <0.21 , servant-server >=0.18.2 && <0.21 , text ^>=1.2.3 || >=2.0 && <2.1 || ^>=2.1 @@ -46,7 +46,7 @@ executable wai-handler-hal-example-hal hs-source-dirs: exe/hal main-is: Main.hs build-depends: - , hal >=0.4.7 && <0.4.11 || >=1.0.0 && <1.1 + , hal >=0.4.7 && <0.4.11 || >=1.0.0 && <1.2 , wai-handler-hal-example ghc-options: -threaded @@ -57,7 +57,7 @@ executable wai-handler-hal-example-warp main-is: Main.hs build-depends: , wai-handler-hal-example - , warp ^>=3.3.14 + , warp >=3.3.14 && <3.4 ghc-options: -threaded From 2b113d3ba4526079bb39801d1b5dfc5c8e1c3326 Mon Sep 17 00:00:00 2001 From: Jack Kelly Date: Tue, 5 Mar 2024 11:40:50 +1000 Subject: [PATCH 4/4] README.md: Add note about `haskell-ci` --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 8e407cd..74e6dcd 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,13 @@ images: Lambda Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/), and the bootstrap binary. + +## Maintaining this Repo + +We don't provide `haskell-ci` in the development shell, in case people +copying the flake don't want it. To regenerate the GitHub Actions +workflow: + +```sh +nix run nixpkgs#haskell-ci regenerate +```