stack build error: attribute ‘ghc822’ missing, at (string):1:53

后端 未结 5 1179
后悔当初
后悔当初 2021-02-14 11:53

I am attempting to build my haskell project on NixOS.

Running $ stack build gives the following error.

$ stack build
error: attribute ‘ghc82         


        
5条回答
  •  礼貌的吻别
    2021-02-14 12:14

    Another option is to use a shell.nix. nixos-18.03 comes with ghc 8.2.2, so you can create a shell.nix like:

    with import (builtins.fetchGit {
        url = https://github.com/NixOS/nixpkgs-channels;
        ref = "nixos-18.03";
        rev = "cb0e20d6db96fe09a501076c7a2c265359982814";
    }) {};
    
    haskell.lib.buildStackProject {
        name = "my-project";
        buildInputs = [ ghc  ];
    }
    

    And add the following to your stack.yaml:

    nix:
      shell-file: shell.nix
    

    Then stack build as usual.

提交回复
热议问题