-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a flake build instead of shell.nix
- Loading branch information
1 parent
2f723e0
commit e59eda0
Showing
6 changed files
with
164 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ cabal.sandbox.config | |
.*.swp | ||
*.log | ||
*.dump-hi | ||
.direnv/ | ||
.envrc | ||
dist-newstyle/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
description = "mat-chalmers goes flakes"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
nixConfig.allow-import-from-derivation = true; # cabal2nix uses IFD | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
let | ||
ghcVer = "ghc810"; | ||
makeHaskellOverlay = overlay: final: prev: { | ||
haskell = prev.haskell // { | ||
packages = prev.haskell.packages // { | ||
${ghcVer} = prev.haskell.packages."${ghcVer}".override (oldArgs: { | ||
overrides = | ||
prev.lib.composeExtensions (oldArgs.overrides or (_: _: { })) | ||
(overlay prev); | ||
}); | ||
}; | ||
}; | ||
}; | ||
|
||
out = system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ self.overlays.default ]; | ||
config.allowBroken = true; | ||
}; | ||
|
||
in | ||
{ | ||
packages = rec { | ||
default = mat; | ||
mat = pkgs.haskell.packages.${ghcVer}.mat; | ||
}; | ||
|
||
checks = { | ||
inherit (self.packages.${system}) mat; | ||
}; | ||
|
||
# for debugging | ||
# inherit pkgs; | ||
|
||
devShells.default = | ||
let haskellPackages = pkgs.haskell.packages.${ghcVer}; | ||
in | ||
haskellPackages.shellFor { | ||
packages = p: [ self.packages.${system}.mat ]; | ||
withHoogle = true; | ||
buildInputs = | ||
[ pkgs.docker ] ++ | ||
(with haskellPackages; [ | ||
haskell-language-server | ||
cabal-install | ||
]); | ||
# Change the prompt to show that you are in a devShell | ||
# shellHook = "export PS1='\\e[1;34mdev > \\e[0m'"; | ||
}; | ||
}; | ||
in | ||
flake-utils.lib.eachDefaultSystem out // { | ||
# this stuff is *not* per-system | ||
overlays = { | ||
default = makeHaskellOverlay (prev: hfinal: hprev: | ||
let hlib = prev.haskell.lib; in | ||
{ | ||
mat = hprev.callCabal2nix "mat" ./. { }; | ||
|
||
# here's how to do hacks to the package set | ||
# don't run the test suite | ||
# fast-tags = hlib.dontCheck hprev.fast-tags; | ||
# | ||
# don't check version bounds | ||
# friendly = hlib.doJailbreak hprev.friendly; | ||
}); | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
cabal-version: 3.0 | ||
name: mat-chalmers | ||
version: 0.1.0.0 | ||
license: MIT | ||
|
@@ -6,7 +7,6 @@ author: Adam Sandberg Eriksson | |
maintainer: [email protected] | ||
category: Web | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
data-files: | ||
static/style.css | ||
static/icon.png | ||
|
@@ -35,17 +35,17 @@ library | |
, exceptions == 0.10.4 | ||
, heredoc == 0.2.0.0 | ||
, http-client | ||
, http-client-tls == 0.3.5.3 | ||
, logging-effect == 1.3.12 | ||
, http-client-tls | ||
, logging-effect | ||
, microlens-platform | ||
, lucid >= 2 | ||
, mtl == 2.2.2 | ||
, old-locale == 1.0.0.7 | ||
, prettyprinter == 1.7.1 | ||
, safe == 0.3.19 | ||
, tagsoup == 0.14.8 | ||
, text == 1.2.4.1 | ||
, bytestring == 0.10.12.0 | ||
, text | ||
, bytestring | ||
, file-embed | ||
, thyme | ||
, word8 == 0.1.3 | ||
|
@@ -58,12 +58,12 @@ executable mat-chalmers | |
, base >= 4.7 | ||
, bytestring | ||
, file-embed | ||
, http-client-tls == 0.3.5.3 | ||
, http-client-tls | ||
, microlens-platform | ||
, logging-effect | ||
, mtl | ||
, scotty | ||
, time == 1.9.3 | ||
, time | ||
, wai-extra | ||
, wai-middleware-static-embedded == 0.1.0.0 | ||
, async >= 2.1.1 | ||
|
@@ -77,7 +77,7 @@ Test-Suite test-mat | |
build-depends: base >= 4.7 | ||
, bytestring | ||
, mat-chalmers | ||
, hspec == 2.7.10 | ||
, hspec | ||
, HUnit == 1.6.2.0 | ||
, text | ||
, thyme == 0.3.5.5 | ||
, thyme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters