Skip to content

Instantly share code, notes, and snippets.

@seanparsons
Last active September 1, 2019 12:05
Show Gist options
  • Save seanparsons/f1a0cfd49704c7dfef0b9db5fb1e5a18 to your computer and use it in GitHub Desktop.
Save seanparsons/f1a0cfd49704c7dfef0b9db5fb1e5a18 to your computer and use it in GitHub Desktop.
Problem with haskell.nix
{}:
let
config = {
allowUnfree = true;
};
bootstrap = import <nixpkgs> { };
nixpkgs = builtins.fromJSON (builtins.readFile ./nixpkgs.json);
nixpkgssrc = bootstrap.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
inherit (nixpkgs) rev sha256;
};
pkgs = import nixpkgssrc { inherit config; };
spec = builtins.fromJSON (builtins.readFile ./haskell-nix-src.json);
haskell-nix-src = pkgs.fetchgit {
name = "haskell-lib";
inherit (spec) url rev sha256 fetchSubmodules;
};
haskell-nix = import haskell-nix-src { inherit pkgs; };
plan = haskell-nix.callCabalProjectToNix {
index-state = "2019-08-26T00:00:00Z";
src = pkgs.lib.cleanSource ./;
};
pkgSet = haskell-nix.mkCabalProjectPkgSet {
plan-pkgs = import plan;
pkg-def-extras = [];
modules = [];
};
in {
pkgs = pkgs;
haskell-nix = haskell-nix;
myPackageName = pkgSet.config.hsPkgs.myPackageName.components.all;
}
$ nix-build --show-trace -A "myPackageName" ./default.nix
error: while evaluating the attribute 'config.hsPkgs.myPackageName.components.all' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:87:25:
while evaluating 'yieldConfig' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:74:29, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:73:16:
while evaluating 'mergeModules' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:190:26, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:64:17:
while evaluating 'mergeModules'' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:194:36, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:191:5:
while evaluating 'flip' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/trivial.nix:101:16, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:237:6:
while evaluating 'byName' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:217:25, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:225:21:
while evaluating 'reverseList' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/lists.nix:393:17, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:64:38:
while evaluating 'filterModules' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:93:31, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:64:51:
while evaluating 'closeModules' at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:101:27, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:62:16:
while evaluating anonymous function at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/lists.nix:116:29, called from undefined position:
while evaluating anonymous function at /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/modules.nix:103:50, called from /nix/store/8z9dfbpw56qafdb30q8dqagdzh2xkvvr-source/lib/lists.nix:116:32:
cannot coerce a set to a string, at /home/sean/myPackageName/default.nix:27:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment