Search code examples
githubnixflake

`nix run .` works, but `nix run github:myorg/myrepo` doesn't


I have a flake.nix with an apps.default among its outputs. If I am in the project directory, the app runs when I run:

nix run .

But when I try to run it from a different machine:

nix run github:myorg/myrepo

I get the following error

error: unable to download 'https://api.github.com/repos/myorg/myrepo/commits/HEAD': HTTP error 404

       response body:

       {
         "message": "Not Found",
         "documentation_url": "https://docs.github.com/rest/commits/commits#get-a-commit"
       }
(use '--show-trace' to show detailed location information)

What am I doing wrong?


Solution

  • If a repo is private, and you are not authenticated, github will respond with a 404.

    Making the repo public solved the problem.