Fix build for NixOS

This commit is contained in:
Gregor Kleen 2018-04-11 14:41:00 +02:00
parent 31510147bd
commit 2464ffb168
2 changed files with 4 additions and 3 deletions

View File

@ -1,11 +1,11 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc822" }: { nixpkgs ? import <nixpkgs> {}, compiler ? null }:
let let
inherit (nixpkgs) pkgs; inherit (nixpkgs) pkgs;
haskellPackages = if isNull compiler haskellPackages = if isNull compiler
then pkgs.haskellPackages then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler}; else pkgs.haskell.packages."${compiler}";
drv = haskellPackages.callPackage ./uniworx.nix {}; drv = haskellPackages.callPackage ./uniworx.nix {};

View File

@ -2,12 +2,13 @@
let let
inherit (nixpkgs) haskell pkgs; inherit (nixpkgs) haskell pkgs;
haskellPackages = if ghc.version == pkgs.haskellPackages.ghc.version then pkgs.haskellPackages else pkgs.haskell.packages."ghc${builtins.replaceStrings ["."] [""] ghc.version}";
in haskell.lib.buildStackProject { in haskell.lib.buildStackProject {
inherit ghc; inherit ghc;
name = "stackenv"; name = "stackenv";
buildInputs = (with pkgs; buildInputs = (with pkgs;
[ postgresql zlib openldap cyrus_sasl.dev [ postgresql zlib openldap cyrus_sasl.dev
]) ++ (with haskell.packages."ghc${builtins.replaceStrings ["."] [""] ghc.version}"; ]) ++ (with haskellPackages;
[ yesod-bin [ yesod-bin
]); ]);
} }