Skip to content

haskell-cabal2nix template not working out of the box #4

Description

@MaxDaten
$ nix --version
nix (Nix) 2.4pre20210601_5985b8b

Hi,

I'm currently diving into nix flakes, thanks for your blog post about flakes. I'm following this guide to generate a cabal2nix hakyll site-generator project: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications

executing (in a subfolder of my repo):

nix flake init -t github:serokell/templates#haskell-cabal2nix

places excatly this repo's haskell-cabal2nix/flake.nix in my project. I replaced packageName with:

- packageName = throw "put your package name here!";
+ packageName = "site-generator";

executing:

nix build

results in error:

error: builder for '/nix/store/pi1vw77kall69hjql189qdw13hf6zvh7-cabal2nix-site-generator.drv' failed with exit code 1;
       last 2 log lines:
       > installing
       > cabal2nix: nix-prefetch-url: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
       For full logs, run 'nix log /nix/store/pi1vw77kall69hjql189qdw13hf6zvh7-cabal2nix-site-generator.drv'.
(use '--show-trace' to show detailed location information)

changing:

 packages.${packageName} =
-  haskellPackages.callCabal2nix packageName self rec {
+  haskellPackages.callCabal2nix packageName ./. rec {
    # Dependency overrides go here
  };

renders nix build successful.

Am I missing something or is it because of a recent change in nix?

Greetings

Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions