DeterminateSystems / flakehub-push

Release your Nix flake to FlakeHub.com.
https://flakehub.com
28 stars 3 forks source link

Enable auto-formatting subgroups in flake names #145

Closed lucperkins closed 4 months ago

lucperkins commented 4 months ago

Gitlab supports subgroups that can nested up to 20 levels, which doesn't work well without our {owner}/{repo} schema for flakes. This PR handles subgroup names by converting all slashes past the first one into dashes. Some example conversions:

"a/b" => "a/b"
"a/b/c" => "a/b-c"
"a/b/c/d" => "a/b-c-d"
"a/b/c/d/e/f/g/h/i/j/k" => "a/b-c-d-e-f-g-h-i-j-k"

There's also a built-in escape hatch from this behavior via FLAKEHUB_PUSH_DISABLE_SUBGROUPS or --disable-subgroups.