diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 5b6ac0789ade..115673728d0b 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -9757,6 +9757,12 @@ githubId = 16470252; name = "Gemini Lasswell"; }; + gbhu753 = { + email = "me@gurjotbhullar.com"; + github = "GBHU753"; + githubId = 100983240; + name = "Gurjot Bhullar"; + }; gbtb = { email = "goodbetterthebeast3@gmail.com"; github = "gbtb"; diff --git a/pkgs/by-name/mo/modctl/package.nix b/pkgs/by-name/mo/modctl/package.nix new file mode 100644 index 000000000000..c910dd3112ad --- /dev/null +++ b/pkgs/by-name/mo/modctl/package.nix @@ -0,0 +1,56 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + versionCheckHook, +}: + +buildGoModule (finalAttrs: { + __structuredAttrs = true; + pname = "modctl"; + version = "0.2.2"; + + src = fetchFromGitHub { + owner = "modelpack"; + repo = "modctl"; + tag = "v${finalAttrs.version}"; + hash = "sha256-A7s2jM+hR5WgeiWzPjjfS/AJy35x6kzewIucz713zLc="; + }; + + vendorHash = "sha256-S1ygAZO3bTFi/3pwmNYE7P/Vqg7AVHpH5YRJ3yzzvyo="; + + ldflags = [ + "-s" + "-X github.com/modelpack/modctl/pkg/version.GitVersion=v${finalAttrs.version}" + ]; + + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "version"; + + # modctl's cobra commands invoke config.NewRoot(), which uses + # os/user.Current() to find the home directory. On darwin os/user + # bypasses $HOME and resolves it via getpwuid (returning /var/empty, + # not writable), so the install check fails. versionCheckHook only + # accepts a single argument, so wrap the binary and point + # --log-dir/--storage-dir at TMPDIR to keep the check working on all + # platforms. + preVersionCheck = '' + wrapper="$NIX_BUILD_TOP/modctl-version-check" + cat > "$wrapper" <