Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskell cabal2nix flake's devshell doesn't have Haskell libraries installed #13

Open
ParetoOptimalDev opened this issue Aug 19, 2022 · 0 comments

Comments

@ParetoOptimalDev
Copy link

ParetoOptimalDev commented Aug 19, 2022

$ git clone https://github.com/ParetoOptimalDev/hello-haskell.nix-devcontainer
$ cd hello-haskell.nix-devcontainer
$ git checkout serokell-haskell4nix-template
$ git log --oneline -n1
369105b (HEAD -> serokell-haskell4nix-template, origin/serokell-haskell4nix-template) revert to match serokell template exactly
$ # well almost exactly, I removed cabal-install, haskell-language-server, and ghcid from devshell buildInputs
$ grep aeson hello.cabal
    build-depends:    base ^>=4.15.1.0, aeson
$ nix develop -c ghc-pkg list | grep aeson
$ cat flake.nix
# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/>
#
# SPDX-License-Identifier: CC0-1.0

{
  description = "My haskell application";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};

        haskellPackages = pkgs.haskellPackages;

        jailbreakUnbreak = pkg:
          pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
        packageName = "hello";
      in {
        packages.${packageName} =
          haskellPackages.callCabal2nix packageName self rec {
            # Dependency overrides go here
          };

        defaultPackage = self.packages.${system}.${packageName};

        devShell = pkgs.mkShell {
          buildInputs = with pkgs; [

          ];
          inputsFrom = builtins.attrValues self.packages.${system};
        };
      });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant