-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
337 additions
and
0 deletions.
There are no files selected for viewing
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,41 @@ | ||
{ | ||
inputs = { | ||
/* The most recent stable channel */ | ||
stable.url = | ||
"github:nixos/nixpkgs/nixos-23.05"; | ||
|
||
/* The unstable channel, the very latest of everything */ | ||
unstable.url = | ||
"github:nixos/nixpkgs/nixos-unstable"; | ||
|
||
/* Hash obtained from https://www.nixhub.io/packages/ghc */ | ||
ghc926.url = | ||
"github:nixos/nixpkgs/796b4a3c1d903c4b9270cd2548fe46f524eeb886"; | ||
|
||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
outputs = inputs: | ||
inputs.flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
nixpkgsArgs = { | ||
inherit system; | ||
config = { }; | ||
}; | ||
|
||
/* An attribute set containing various historic versions of the huge Nix | ||
package database. This is passed as an argument to functions in the | ||
./nix directory which can then select which versions they want to pull | ||
each dependency from. */ | ||
|
||
nixpkgs = { | ||
stable = import inputs.stable nixpkgsArgs; | ||
unstable = import inputs.unstable nixpkgsArgs; | ||
ghc926 = import inputs.ghc926 nixpkgsArgs; | ||
}; | ||
|
||
in | ||
{ | ||
devShells.default = | ||
import ./nix/shell.nix { inherit nixpkgs; }; | ||
}); | ||
} |
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,2 @@ | ||
{ nixpkgs }: | ||
nixpkgs.stable.cabal-install |
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,30 @@ | ||
/* | ||
These are overrides for Haskell packages that are marked as broken in nixpkgs | ||
solely because their tests fail. The test failures are typically just because | ||
the tests don't work in a pure nix environment, and so here we override them by | ||
skipping the tests and marking the package as not broken. | ||
*/ | ||
{ nixpkgs }: | ||
let | ||
list = [ | ||
"Blammo" | ||
"datadog" | ||
"dotenv" | ||
"hspec-junit-formatter" | ||
]; | ||
inherit (builtins) map listToAttrs; | ||
inherit (nixpkgs.stable.haskell.lib) overrideCabal; | ||
in | ||
|
||
self: super: | ||
listToAttrs ( | ||
map | ||
(name: { | ||
inherit name; | ||
value = overrideCabal super.${name} | ||
(drv: { doCheck = false; broken = false; }); | ||
}) | ||
list | ||
) |
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,15 @@ | ||
{ nixpkgs }: | ||
let | ||
inherit (nixpkgs.stable) haskell; | ||
inherit (haskell.lib) justStaticExecutables overrideCabal; | ||
in | ||
justStaticExecutables | ||
(haskell.packages.ghc96.override { | ||
inherit (nixpkgs.unstable) all-cabal-hashes; | ||
overrides = self: super: { | ||
fourmolu = | ||
overrideCabal | ||
(super.callHackage "fourmolu" "0.13.0.0" { }) | ||
(drv: { doCheck = false; }); | ||
}; | ||
}).fourmolu |
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,23 @@ | ||
/* | ||
This package contains GHC and a bunch of Haskell packages. | ||
It is important for the GHC version to match exactly what is expected by our | ||
current Stack resolver. | ||
It is less important for the packages to stay in sync with Stack, because if | ||
Stack doesn't find what it wants in the shell environment, Stack will happily | ||
build the dependencies it wants on its own. However, the better the nix shell | ||
can stay in sync with Stack, the more benefit we can get out of it in terms of | ||
build reproducibility and being able to utilize the nix binary cache for speed. | ||
*/ | ||
{ nixpkgs }: | ||
let | ||
haskellPackages = nixpkgs.ghc926.haskellPackages.override { | ||
inherit (nixpkgs.unstable) all-cabal-hashes; | ||
overrides = import ./haskell-package-overrides.nix | ||
{ inherit nixpkgs; }; | ||
}; | ||
in | ||
haskellPackages.ghcWithPackages (import ./haskell-package-selection.nix) |
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,3 @@ | ||
{ nixpkgs }: | ||
nixpkgs.stable.haskell-language-server.override | ||
{ supportedGhcVersions = [ "926" ]; } |
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,36 @@ | ||
/* | ||
This package provides native dependencies of Haskell packages. | ||
If Stack gives you an error message like... | ||
- setup: The program '...' is required but it could not be found. | ||
- The pkg-config package '...' is required but it could not be found. | ||
- Missing dependency on a foreign library: Missing (or bad) C library: ... | ||
... then you probably need to add something to this file. | ||
To test that a Haskell package actually builds correctly within the nix | ||
shell environment, it can help to first remove the package from the cache. | ||
You can do that by running this command: | ||
stack exec -- ghc-pkg unregister --force <haskell package name> | ||
Then run `stack build <haskell package name>` to recompile. | ||
*/ | ||
{ nixpkgs }: | ||
let | ||
pkgs = nixpkgs.stable; | ||
in | ||
pkgs.symlinkJoin { | ||
name = "freckle-app-native-deps"; | ||
paths = [ | ||
pkgs.pcre | ||
pkgs.pcre.dev | ||
pkgs.postgresql | ||
pkgs.rdkafka | ||
pkgs.zlib | ||
pkgs.zlib.dev | ||
]; | ||
} |
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,7 @@ | ||
{ nixpkgs }: | ||
let | ||
inherit (nixpkgs.stable.lib) fold composeExtensions; | ||
in | ||
fold composeExtensions (_: _: { }) [ | ||
(import ./disabled-haskell-tests.nix { inherit nixpkgs; }) | ||
] |
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,69 @@ | ||
p: with p; [ | ||
Blammo | ||
Glob | ||
MonadRandom | ||
QuickCheck | ||
aeson | ||
aws-xray-client-persistent | ||
aws-xray-client-wai | ||
bugsnag | ||
bytestring | ||
case-insensitive | ||
cassava | ||
conduit | ||
conduit-extra | ||
containers | ||
datadog | ||
doctest | ||
dotenv | ||
ekg-core | ||
envparse | ||
errors | ||
exceptions | ||
extra | ||
filepath | ||
hashable | ||
hspec | ||
hspec-core | ||
hspec-expectations-lifted | ||
hspec-junit-formatter | ||
http-client | ||
http-conduit | ||
http-link-header | ||
http-types | ||
hw-kafka-client | ||
immortal | ||
lens | ||
lens-aeson | ||
memcache | ||
monad-control | ||
monad-validate | ||
mtl | ||
network-uri | ||
nonempty-containers | ||
path-pieces | ||
persistent | ||
persistent-postgresql | ||
postgresql-simple | ||
primitive | ||
resourcet | ||
resource-pool | ||
retry | ||
safe | ||
scientist | ||
semigroupoids | ||
template-haskell | ||
text | ||
time | ||
transformers | ||
transformers-base | ||
typed-process | ||
unliftio | ||
unliftio-core | ||
unordered-containers | ||
vector | ||
wai | ||
wai-extra | ||
yaml | ||
yesod-core | ||
] |
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,14 @@ | ||
{ nixpkgs }: | ||
nixpkgs.stable.mkShell { | ||
name = "freckle-app-shell"; | ||
buildInputs = | ||
map (x: import x { inherit nixpkgs; }) | ||
[ | ||
./cabal.nix | ||
./fourmolu.nix | ||
./ghc-with-packages.nix | ||
./haskell-language-server.nix | ||
./haskell-native-dependencies.nix | ||
./stack.nix | ||
]; | ||
} |
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,2 @@ | ||
{ nixpkgs }: | ||
nixpkgs.stable.stack |