+

+ Codeberg is a Forgejo (FOSS) Git forge instance ran by a German non-profit. +The instance offers gratis accounts (terms apply). +

+
+

+ How to pin a Codeberg repository with Nix + Nixtamal +

+

+ Let’s show the way using the Biboumi repository. +When you write this, you will substitute the owner & project slugs. +In most cases, you will want to prefer fetching the archive (Forgejo supports gzip) over the Git input kind. +git ls-remote is preferred by us for being more generic. +

+

+ Latest revision +

+
// manifest.kdl
+inputs {
+	soupault {
+		archive {
+			url "https://codeberg.org/poezio/biboumi/archive/{{fresh-value}}.tar.gz"
+		}
+	}
+	fresh-cmd {
+		$ git ls-remote --branches main "https://codeberg.org/poezio/biboumi.git"
+		| cut -f1
+	}
+}
+

+ Latest stable release tag +

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