From 9df2b49afd4217edb0307a2b17d04a5978bd5b8c Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 9 Aug 2020 10:19:36 +0100 Subject: [PATCH] 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. --- .../learnpianochords/src/server/default.nix | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 website/sandbox/learnpianochords/src/server/default.nix diff --git a/website/sandbox/learnpianochords/src/server/default.nix b/website/sandbox/learnpianochords/src/server/default.nix new file mode 100644 index 000000000..a39f89b04 --- /dev/null +++ b/website/sandbox/learnpianochords/src/server/default.nix @@ -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 + ''; +}