Skip to content

error in flake. #2506

Description

@stepa1000

I copy flake with nix flake init --template templates#haskell-nix --impure,
but when i run nix develop
I get:

warning: Git tree '/home/stepan/Documents/GitHub/Axon-space-hs' is dirty
warning: ignoring untrusted substituter 'https://cache.iog.io', you are not a trusted user.
Run `man nix.conf` for more information on the `substituters` configuration option.
warning: ignoring the client-specified setting 'trusted-public-keys', because it is a restricted setting and you are not a trusted user
evaluation warning: Nixpkgs 26.05 will be the last release to support x86_64-darwin; see https://nixos.org/manual/nixpkgs/unstable/release-notes#x86_64-darwin-26.05
trace: WARNING: `cleanSourceWith` called on /nix/store/qwvgspf2adgklgdbb193fsila1dz9km5-source without a `name`. Consider adding `name = "qwvgspf2adgklgdbb193fsila1dz9km5-source";`
error:
       … while evaluating the attribute 'packages'
         at /nix/store/qwvgspf2adgklgdbb193fsila1dz9km5-source/flake.nix:42:9:
           41|
           42|         packages = flake.packages // { default = flake.packages."Axon-space-hs:exe:Axon-space-hs-exe"; };
             |         ^
           43|       });

       … in the left operand of the update (//) operator
         at /nix/store/qwvgspf2adgklgdbb193fsila1dz9km5-source/flake.nix:42:35:
           41|
           42|         packages = flake.packages // { default = flake.packages."Axon-space-hs:exe:Axon-space-hs-exe"; };
             |                                   ^
           43|       });

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: Cannot build '/nix/store/ys74y35ihxcrjlcl6phw8m1lgxvi0q09-stack-repos.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/k9pslgmk7c27icay8xxyg66w64sdpl5p-stack-repos
       Last 5 log lines:
       > substituteStream() in derivation stack-repos: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'stack.yaml')
       > substituteStream() in derivation stack-repos: WARNING: pattern \#\ nix-sha256: doesn't match anything in file 'stack.yaml'
       > stack-repos: AesonException "Error in $: key \"resolver\" not found"
       > CallStack (from HasCallStack):
       >   error, called at lib/StackRepos.hs:36:15 in nix-tools-0.1.0.0-Hsb4lIKiGVOCO64PwH8LnT:StackRepos
       For full logs, run:
         nix log /nix/store/ys74y35ihxcrjlcl6phw8m1lgxvi0q09-stack-repos.drv

I modify flake.nix, now is:

 {
  # This is a template created by `hix init`
  inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
  inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";
  outputs = { self, nixpkgs, flake-utils, haskellNix }:
    let
      supportedSystems = [
        "x86_64-linux"
        "x86_64-darwin"
      ];
    in
      flake-utils.lib.eachSystem supportedSystems (system:
      let
        overlays = [ haskellNix.overlay
          (final: prev: {
            hixProject =
              final.haskell-nix.hix.project {
                src = ./.;
                evalSystem = "x86_64-linux";
		shell.tools = {
		  stack = {};
		  };
	        shell.buildInputs = with pkgs; [
                  zlib # Example of a C library dependency
                  OpenGL
                  freeglut
                  gl
	          GLUT
	          GLUtil
                  libGL
                  libGLU
		  ];
              };
          })
        ];
        pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
        flake = pkgs.hixProject.flake {};
      in flake // {
        legacyPackages = pkgs;

        packages = flake.packages // { default = flake.packages."Axon-space-hs:exe:Axon-space-hs-exe"; };
      });

  # --- Flake Local Nix Configuration ----------------------------
  nixConfig = {
    # This sets the flake to use the IOG nix cache.
    # Nix should ask for permission before using it,
    # but remove it here if you do not want it to.
    extra-substituters = ["https://cache.iog.io"];
    extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="];
    allow-import-from-derivation = "true";
  };
}

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