on hkm/haskell-nix-tools help sign in
haskell.nix/default.nix
24 lines 887 B history raw
1let haskellNix = rec {
2 sources = {
3 inherit (import ./nixpkgs/default.nix) nixpkgs-1903 nixpkgs-1909 nixpkgs-default;
4 };
6 config = import ./config.nix;
7 overlays = import ./overlays;
8 nixpkgsArgs = { inherit overlays config; };
9 };
11 haskellNixV1 = haskellNix.nixpkgsArgs;
12 haskellNixV2 = haskellNix;
14 v1DeprecationMessage = "Version 1 is deprecated: use version 2 (nixpkgs arguments are available as the `nixpkgsArgs` attribute of version 2)";
15# If no arguments, then you get V1
16# I'd like to make importing directly issue a warning, but I couldn't figure out a way to make it happen
17in haskellNixV1 // {
18 __functor = _: { version ? 2 }:
19 if version == 1
20 then builtins.trace v1DeprecationMessage haskellNixV1
21 else if version == 2
22 then haskellNixV2
23 else builtins.throw ("haskell.nix: unknown version: " + (builtins.toString version));