Skip to content

Commit

Permalink
Merge pull request #7 from bellroy/feat/hydraify-repo
Browse files Browse the repository at this point in the history
Feat/hydraify repo
  • Loading branch information
JackKelly-Bellroy authored Mar 5, 2024
2 parents d71eebe + 2b113d3 commit 21177d1
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 17 deletions.
14 changes: 14 additions & 0 deletions .hydra/spec.json
Original file line number Diff line number Diff line change
@@ -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://[email protected]/bellroy/wai-handler-hal-example"
}
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
40 changes: 27 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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.
Expand All @@ -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 {
Expand All @@ -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 = pkgsLocal.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";
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions wai-handler-hal-example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 21177d1

Please sign in to comment.