We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With the following flake:
{ description = "A reimplementation of Sandstorm in Go"; inputs = { nixpkgs.url = "nixpkgs/nixos-23.05"; gomod2nix.url = "github:nix-community/gomod2nix"; }; outputs = { self, nixpkgs, gomod2nix }: let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); in { packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; gonix = (gomod2nix.legacyPackages.${system}); tempest-src = pkgs.fetchFromGitHub { name = "tempest-src"; owner = "troyjfarrell"; repo = "tempest"; rev = "main"; hash = "sha256-V2+4VXqxbUpTWYrfzxpblzbsJKhAPXe5SoCii3+zxow="; }; in { tempest = gonix.mkGoEnv { pwd = "${tempest-src}"; modules = ./gomod2nix.toml; }; }); defaultPackage = forAllSystems (system: self.packages.${system}.tempest); }; }
evaluation during nix build fails with: error: go.mod specified Go version 1.20, but no compatible Go attribute could be found.
nix build
Yet the following works in the repl:
nix-repl> :l <nixpkgs> Added 19222 variables. nix-repl> :t buildPackages a set nix-repl> lib.reverseList (builtins.filter (attr: lib.hasPrefix "go_" attr && lib.versionAtLeast buildPackages.${attr}.version "1.20")(lib.attrNames buildPackages)) [ "go_1_20" ]
The text was updated successfully, but these errors were encountered:
So I don't exactly know why this was complaining since the current go version is 1.23 and I am using 1.22 which according to the comments on https://github.com/nix-community/gomod2nix/blob/master/builder/default.nix#L129
but I did this to resolve the error and make it happy
I added a go attribute pointing to the correct go package for the project
go
devShells = forEachSupportedSystem ({ pkgs, gomod2nix }: { default = pkgs.mkShell { packages = with pkgs; [ (gomod2nix.mkGoEnv { pwd = ./.; go = go_1_22; }) gnumake gomod2nix ]; }; });
Sorry, something went wrong.
No branches or pull requests
With the following flake:
evaluation during
nix build
fails with:error: go.mod specified Go version 1.20, but no compatible Go attribute could be found.
Yet the following works in the repl:
The text was updated successfully, but these errors were encountered: