2
submitted 1 year ago by curtismchale@lemmy.ca to c/nixos@lemmy.ml

I'm trying to build my first nix package out of the Kana project. My `default.nix' file is below.

When I try to build the application nix tries to fetch https://github.com/ChrisWiegman/kana-cli/archive/v0.10.1.tar.gz which gives a 404. How do I get nix to download the release .tar.gz file to build the application?

{ lib
, buildGoModule
, fetchFromGitHub
, makeWrapper
, go
}:

buildGoModule rec {
  pname = "kana-cli";
  version = "0.10.1";

  src = fetchFromGitHub {
    owner = "ChrisWiegman";
    repo = "kana-cli";
    rev = "v${version}";
    hash = "";
  };

  vendorSha256 = null;

  # This is required for wrapProgram.
  allowGoReference = true;

  nativeBuildInputs = [ makeWrapper ];

  postFixup = ''
    wrapProgram $out/bin/kana-cli --prefix PATH : ${lib.makeBinPath [ go ]}
  '';

  meta = with lib; {
    homepage = "https://github.com/ChrisWiegman/kana-cli";
    description = "WordPress Stuff";
    license = licenses.gpl3;
    maintainers = with maintainers; [ curtismchale ];
  };
}
you are viewing a single comment's thread
view the rest of the comments
[-] curtismchale@lemmy.ca 2 points 1 year ago* (last edited 1 year ago)

So the line of rev = "v${version}"; has an extra v in it which corresponded to the repository I copied to get started but this isn't needed for my repository.

my correct line reads rev = "${version}"

[-] rycee@lemmy.world 1 points 1 year ago

You can simplify that further to just rev = version...

this post was submitted on 13 Jul 2023
2 points (100.0% liked)

nixos

1244 readers
1 users here now

All about NixOS - https://nixos.org/

founded 4 years ago