Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go-hello/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "A simple Go package";

# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-21.11";
inputs.nixpkgs.url = "nixpkgs/nixos-24.11";

outputs = { self, nixpkgs }:
let
Expand Down Expand Up @@ -48,7 +48,7 @@
# remember to bump this hash when your dependencies change.
# vendorHash = pkgs.lib.fakeHash;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not set pkgs.lib.fakeHash?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I try to use nix run on the main.go from the example and the property is vendorHash = pkgs.lib.fakeHash; it fails with:

image

So I just followed the suggestion haha.

The complete log is:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/0q954y6cv7baz5q3izp9yxjssisms2fp-go-hello
source root is go-hello
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
go: no dependencies to vendor
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
vendor folder is empty, please set 'vendorHash = null;' in your expression

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok interesting


vendorHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
vendorHash = null;
};
});

Expand Down
2 changes: 1 addition & 1 deletion go-hello/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module example.com/go-hello

go 1.16
go 1.23