Skip to content

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

Description

@ParetoOptimalDev
$ 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};
        };
      });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions