From cf617bc908503c56b024426f944466c44f03ba7b Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Mon, 8 Sep 2025 18:11:22 -0700 Subject: [PATCH 1/3] engage: use finalAttrs --- pkgs/by-name/en/engage/package.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/en/engage/package.nix b/pkgs/by-name/en/engage/package.nix index 51fdd91008f9..45a5888cb10b 100644 --- a/pkgs/by-name/en/engage/package.nix +++ b/pkgs/by-name/en/engage/package.nix @@ -6,18 +6,15 @@ stdenv, }: -let +rustPlatform.buildRustPackage (finalAttrs: { pname = "engage"; version = "0.2.0"; -in -rustPlatform.buildRustPackage { - inherit pname version; src = fetchFromGitLab { domain = "gitlab.computer.surgery"; owner = "charles"; repo = "engage"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-niXh63xTpXSp9Wqwfi8hUBKJSClOUSvB+TPCTaqHfZk="; }; @@ -42,11 +39,11 @@ rustPlatform.buildRustPackage { description = "Task runner with DAG-based parallelism"; mainProgram = "engage"; homepage = "https://gitlab.computer.surgery/charles/engage"; - changelog = "https://gitlab.computer.surgery/charles/engage/-/blob/v${version}/CHANGELOG.md"; + changelog = "https://gitlab.computer.surgery/charles/engage/-/blob/v${finalAttrs.version}/CHANGELOG.md"; license = with lib.licenses; [ asl20 mit ]; maintainers = with lib.maintainers; [ CobaltCause ]; }; -} +}) From 583abd2e0fb25e83f39c306991c13a1e70c07d0e Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Mon, 8 Sep 2025 18:14:23 -0700 Subject: [PATCH 2/3] engage: 0.2.0 -> 0.2.1 Also update the changelog link. --- pkgs/by-name/en/engage/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/en/engage/package.nix b/pkgs/by-name/en/engage/package.nix index 45a5888cb10b..426ad3883eaf 100644 --- a/pkgs/by-name/en/engage/package.nix +++ b/pkgs/by-name/en/engage/package.nix @@ -8,17 +8,17 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "engage"; - version = "0.2.0"; + version = "0.2.1"; src = fetchFromGitLab { domain = "gitlab.computer.surgery"; owner = "charles"; repo = "engage"; rev = "v${finalAttrs.version}"; - hash = "sha256-niXh63xTpXSp9Wqwfi8hUBKJSClOUSvB+TPCTaqHfZk="; + hash = "sha256-n7ypFJBYT712Uzh1NnWWSOIpEDKR0e6sQxbiIN6pZgo="; }; - cargoHash = "sha256-0r5MIoitmFxUODxzi0FBLsUpdGrG1pY8Lo+gy7HeJU8="; + cargoHash = "sha256-UTIxxPBtxzsZilxriAT8ksl2ovoDzIhB+8f+b2cGN3k="; nativeBuildInputs = [ installShellFiles @@ -39,7 +39,7 @@ rustPlatform.buildRustPackage (finalAttrs: { description = "Task runner with DAG-based parallelism"; mainProgram = "engage"; homepage = "https://gitlab.computer.surgery/charles/engage"; - changelog = "https://gitlab.computer.surgery/charles/engage/-/blob/v${finalAttrs.version}/CHANGELOG.md"; + changelog = "https://charles.gitlab-pages.computer.surgery/engage/changelog.html"; license = with lib.licenses; [ asl20 mit From 6fb61c6e093800d21367e4ad7d8ad5f128572e45 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Mon, 8 Sep 2025 18:22:51 -0700 Subject: [PATCH 3/3] engage: build/include documentation --- pkgs/by-name/en/engage/package.nix | 40 ++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/en/engage/package.nix b/pkgs/by-name/en/engage/package.nix index 426ad3883eaf..59c8c0f59952 100644 --- a/pkgs/by-name/en/engage/package.nix +++ b/pkgs/by-name/en/engage/package.nix @@ -4,12 +4,22 @@ rustPlatform, fetchFromGitLab, stdenv, + mdbook, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "engage"; version = "0.2.1"; + outputs = [ + "out" + "doc" + ]; + + env = { + ENGAGE_DOCS_LINK = "file://${builtins.placeholder "doc"}/share/doc/${finalAttrs.pname}/index.html"; + }; + src = fetchFromGitLab { domain = "gitlab.computer.surgery"; owner = "charles"; @@ -24,16 +34,26 @@ rustPlatform.buildRustPackage (finalAttrs: { installShellFiles ]; - postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ( - "installShellCompletion --cmd engage " - + builtins.concatStringsSep " " ( - builtins.map (shell: "--${shell} <($out/bin/engage completions ${shell})") [ - "bash" - "fish" - "zsh" - ] - ) - ); + checkFlags = [ + # Upstream doesn't set `ENGAGE_DOCS_LINK` during tests so the output differs. + "--skip=long_help" + ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd engage ${ + builtins.concatStringsSep " " ( + builtins.map (shell: "--${shell} <($out/bin/engage completions ${shell})") [ + "bash" + "zsh" + "fish" + ] + ) + } + + ${lib.getExe mdbook} build + mkdir -p "$doc/share/doc" + mv public "$doc/share/doc/${finalAttrs.pname}" + ''; meta = { description = "Task runner with DAG-based parallelism";