canvas/default.nix
2020-02-06 05:10:56 +01:00

40 lines
1.2 KiB
Nix

let
# import niv packages
sources = import ./nix/sources.nix;
overlay = _: pkgs:
{ niv = import sources.niv {}; # use the sources :)
};
pkgs1 = import sources.nixpkgs {
overlays = [ overlay ];
config = {};
#import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz)
};
# Import the Haskell.nix library,
pkgs2 = import <nixpkgs>
(import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz))
;
pkgs = pkgs1 // pkgs2;
# Import the file you will create in the stack-to-nix or cabal-to-nix step.
my-pkgs = import ./pkgs.nix;
# Cabal projects use this:
pkgSet = pkgs.haskell-nix.mkCabalProjectPkgSet {
plan-pkgs = my-pkgs;
pkg-def-extras = [];
modules = [
# specific package overrides would go here
# example:
# packages.cbors.package.ghcOptions = "-Werror";
# packages.cbors.patches = [ ./one.patch ];
# packages.cbors.flags.optimize-gmp = false;
# It may be better to set flags in `cabal.project` instead
# (`plan-to-nix` will include them as defaults).
];
};
in pkgSet.config.hsPkgs //
{ _config = pkgSet.config; }