GitHub is a U.S.-based closed-source, proprietary Git forge & social media platform owned by Microsoft. There is a gratis tier for repositories (terms apply). When you write an input of this kind, you will substitute the owner & project slugs.

How to pin a Micosoft GitHub repository with Nix + Nixtamal

Let’s show the way using the Movim repository. When you do this, you will substitute the owner & project slugs. In most cases, you will want to prefer fetching the archive (Microsoft GitHub supports gzip) over the Git input kind. git ls-remote is preferred by us for being more generic & anecdotally having less issues with throttling.

Latest revision

// manifest.kdl
inputs {
	movim {
		archive {
			url "https://github.com/movim/movim/archive/{{fresh-value}}.tar.gz"
		}
	}
	fresh-cmd {
		$ git ls-remote --heads "https://github.com/movim/movim.git"
		| cut -f1
	}
}

Latest release tag

// manifest.kdl
inputs {
	movim {
		archive {
			url "https://github.com/movim/movim/archive/{{fresh-value}}.tar.gz"
		}
	}
	fresh-cmd {
		$ git ls-remote --tags --sort=v:refname "https://github.com/movim/movim.git"
		| grep -E "'refs/tags/v([0-9]+\\.)+[0-9]+$'"
		| tail -n1
		| sed "'s|.*refs/tags/||'"
	}
}