Initialize a default.nix for nix-build

As the previous commit mentions, I'm attempting to build and deploy this project
with `nix-shell` and `nix-build` instead of `cabal` and `stack`.

I'm in the Hamburg airport right now, and my internet connection isn't stable
enough to test this, so I'm committing it until I can more robustly test it.
This commit is contained in:
William Carroll 2020-08-09 10:19:36 +01:00
parent 119c8e9df9
commit 9df2b49afd

View file

@ -0,0 +1,27 @@
let
pkgs = import /home/wpcarro/nixpkgs {};
ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: [
hpkgs.servant-server
hpkgs.aeson
hpkgs.wai-cors
hpkgs.warp
hpkgs.jwt
hpkgs.unordered-containers
hpkgs.base64
hpkgs.http-conduit
hpkgs.rio
]);
in pkgs.stdenv.mkDerivation {
name = "LearnPianoChords-server";
srcs = builtins.path {
path = ./.;
name = "LearnPianoChords-server-src";
};
buildPhase = ''
${ghc} -O Main.hs \
-XOverloadedStrings \
-XNoImplicitPrelude \
-XRecordWildCards \
-XTypeApplications
'';
}