diff options
author | maralorn <malte.brandy@maralorn.de> | 2022-03-08 15:54:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-08 15:54:16 +0100 |
commit | f3583e5c2d3560c8f891b7ede545a8854932bdbd (patch) | |
tree | 25590345e639ca236a4bb5457fbb4e99a73a6ea2 /pkgs/tools | |
parent | 490fb9b3356ef0eaeea97dd7b85977ece62c139c (diff) | |
parent | de687e6c8e18221e43e2316d156014b3d6750b9a (diff) | |
download | nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.tar nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.tar.gz nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.tar.bz2 nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.tar.lz nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.tar.xz nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.tar.zst nixlib-f3583e5c2d3560c8f891b7ede545a8854932bdbd.zip |
Merge pull request #163211 from maralorn/update-nom
nix-output-monitor: 1.0.5.0 -> 1.1.1.0
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/nix/nix-output-monitor/default.nix | 151 | ||||
-rwxr-xr-x | pkgs/tools/nix/nix-output-monitor/update.sh | 40 |
2 files changed, 170 insertions, 21 deletions
diff --git a/pkgs/tools/nix/nix-output-monitor/default.nix b/pkgs/tools/nix/nix-output-monitor/default.nix index 5c4c64c15490..214a25b36803 100644 --- a/pkgs/tools/nix/nix-output-monitor/default.nix +++ b/pkgs/tools/nix/nix-output-monitor/default.nix @@ -1,32 +1,145 @@ -{ mkDerivation, ansi-terminal, async, attoparsec, base, containers -, cassava, directory, HUnit, mtl, nix-derivation, process, relude, lib -, stm, terminal-size, text, time, unix, wcwidth, fetchFromGitHub -, lock-file, data-default, expect, runtimeShell +# This file has been autogenerate with cabal2nix. +# Update via ./update.sh" +{ + mkDerivation, + ansi-terminal, + async, + attoparsec, + base, + cassava, + containers, + data-default, + directory, + expect, + extra, + fetchzip, + filepath, + generic-optics, + HUnit, + lib, + lock-file, + MemoTrie, + mtl, + nix-derivation, + optics, + process, + random, + relude, + runtimeShell, + safe, + stm, + streamly, + terminal-size, + text, + time, + unix, + vector, + wcwidth, }: -mkDerivation rec { +mkDerivation { pname = "nix-output-monitor"; - version = "1.0.5.0"; - src = fetchFromGitHub { - owner = "maralorn"; - repo = "nix-output-monitor"; - hash = "sha256-7vjGE/MfRlFplGQBkhYwqMWjiFfky7J9aI8Tt5FycBo="; - rev = "v${version}"; + version = "1.1.1.0"; + src = fetchzip { + url = "https://github.com/maralorn/nix-output-monitor/archive/refs/tags/v1.1.1.0.tar.gz"; + sha256 = "1zw7x1snyycl1bp5w7jh8wwnynqvw3g4glr293bnzi5jyirj5wlg"; }; isLibrary = true; isExecutable = true; libraryHaskellDepends = [ - ansi-terminal async attoparsec base cassava containers directory mtl - nix-derivation relude stm terminal-size text time unix wcwidth lock-file + ansi-terminal + async + attoparsec + base + cassava + containers data-default + directory + extra + filepath + generic-optics + lock-file + MemoTrie + mtl + nix-derivation + optics + random + relude + safe + stm + streamly + terminal-size + text + time + unix + vector + wcwidth ]; executableHaskellDepends = [ - ansi-terminal async attoparsec base containers directory mtl - nix-derivation relude stm text time unix + ansi-terminal + async + attoparsec + base + cassava + containers + data-default + directory + extra + filepath + generic-optics + lock-file + MemoTrie + mtl + nix-derivation + optics + random + relude + safe + stm + streamly + terminal-size + text + time + unix + vector + wcwidth ]; testHaskellDepends = [ - ansi-terminal async attoparsec base containers directory HUnit mtl - nix-derivation process relude stm text time unix + ansi-terminal + async + attoparsec + base + cassava + containers + data-default + directory + extra + filepath + generic-optics + HUnit + lock-file + MemoTrie + mtl + nix-derivation + optics + process + random + relude + safe + stm + streamly + terminal-size + text + time + unix + vector + wcwidth ]; + homepage = "https://github.com/maralorn/nix-output-monitor"; + description = "Parses output of nix-build to show additional information"; + license = lib.licenses.agpl3Plus; + maintainers = with lib.maintainers; [maralorn]; + passthru.updateScript = ./update.sh; + testTarget = "unit-tests"; postInstall = '' cat > $out/bin/nom-build << EOF #!${runtimeShell} @@ -34,8 +147,4 @@ mkDerivation rec { EOF chmod a+x $out/bin/nom-build ''; - homepage = "https://github.com/maralorn/nix-output-monitor"; - description = "Parses output of nix-build to show additional information"; - license = lib.licenses.agpl3Plus; - maintainers = [ lib.maintainers.maralorn ]; } diff --git a/pkgs/tools/nix/nix-output-monitor/update.sh b/pkgs/tools/nix/nix-output-monitor/update.sh new file mode 100755 index 000000000000..938736e91942 --- /dev/null +++ b/pkgs/tools/nix/nix-output-monitor/update.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p cabal2nix curl jq alejandra +# +# This script will update the nix-output-monitor derivation to the latest version using +# cabal2nix. + +set -eo pipefail + +# This is the directory of this update.sh script. +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +derivation_file="${script_dir}/default.nix" + +# This is the latest released version of nix-output-monitor on GitHub. +new_version=$(curl --silent "https://api.github.com/repos/maralorn/nix-output-monitor/releases" | jq '.[0].tag_name' --raw-output) + +echo "Updating nix-output-monitor to version $new_version." +echo "Running cabal2nix and outputting to ${derivation_file}..." + +cat > "$derivation_file" << EOF +# This file has been autogenerate with cabal2nix. +# Update via ./update.sh" +EOF +cabal2nix --extra-arguments expect --extra-arguments runtimeShell --maintainer maralorn "https://github.com/maralorn/nix-output-monitor/archive/refs/tags/${new_version}.tar.gz" | head -n-1 >> "$derivation_file" +cat >> "$derivation_file" << EOF + passthru.updateScript = ./update.sh; + testTarget = "unit-tests"; + postInstall = '' + cat > \$out/bin/nom-build << EOF + #!\${runtimeShell} + \${expect}/bin/unbuffer nix-build "\\\$@" 2>&1 | exec \$out/bin/nom + EOF + chmod a+x \$out/bin/nom-build + ''; +} +EOF + +alejandra "${derivation_file}" | cat + +echo "Finished." |