Merge pull request #310859 from JohnRTitor/add-update-script

treewide: add update script to packages maintained by johnrtitor

authored by Aleksana and committed by GitHub abd6d48f 4b91ebb8

+29 -11
+5
pkgs/by-name/an/ananicy-rules-cachyos/package.nix
··· 2 lib, 3 stdenvNoCC, 4 fetchFromGitHub, 5 }: 6 7 stdenvNoCC.mkDerivation { ··· 25 cp -r * $out/etc/ananicy.d 26 runHook postInstall 27 ''; 28 29 meta = { 30 homepage = "https://github.com/CachyOS/ananicy-rules";
··· 2 lib, 3 stdenvNoCC, 4 fetchFromGitHub, 5 + unstableGitUpdater, 6 }: 7 8 stdenvNoCC.mkDerivation { ··· 26 cp -r * $out/etc/ananicy.d 27 runHook postInstall 28 ''; 29 + 30 + passthru.updateScript = unstableGitUpdater { 31 + hardcodeZeroVersion = true; 32 + }; 33 34 meta = { 35 homepage = "https://github.com/CachyOS/ananicy-rules";
+12 -1
pkgs/by-name/go/google-chrome/package.nix
··· 1 - { lib, stdenv, patchelf, makeWrapper, fetchurl 2 3 # Linked dynamic libraries. 4 , glib, fontconfig, freetype, pango, cairo, libX11, libXi, atk, nss, nspr ··· 141 142 runHook postInstall 143 ''; 144 145 meta = { 146 description = "A freeware web browser developed by Google";
··· 1 + { lib, stdenv, patchelf, makeWrapper, fetchurl, writeScript 2 3 # Linked dynamic libraries. 4 , glib, fontconfig, freetype, pango, cairo, libX11, libXi, atk, nss, nspr ··· 141 142 runHook postInstall 143 ''; 144 + 145 + passthru = { 146 + updateScript = writeScript "update-google-chrome.sh" '' 147 + #!/usr/bin/env nix-shell 148 + #!nix-shell -i bash -p curl jq common-updater-scripts 149 + url="https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions/all/releases" 150 + response=$(curl --silent $url) 151 + version=$(jq ".releases[0].version" --raw-output <<< "$response") 152 + update-source-version ${finalAttrs.pname} "$version" --ignore-same-hash 153 + ''; 154 + }; 155 156 meta = { 157 description = "A freeware web browser developed by Google";
+3
pkgs/by-name/li/lightningcss/package.nix
··· 2 , stdenv 3 , rustPlatform 4 , fetchFromGitHub 5 }: 6 7 rustPlatform.buildRustPackage rec { ··· 36 cargoTestFlags = [ 37 "--lib" 38 ]; 39 40 meta = with lib; { 41 description = "Extremely fast CSS parser, transformer, and minifier written in Rust";
··· 2 , stdenv 3 , rustPlatform 4 , fetchFromGitHub 5 + , nix-update-script 6 }: 7 8 rustPlatform.buildRustPackage rec { ··· 37 cargoTestFlags = [ 38 "--lib" 39 ]; 40 + 41 + passthru.updateScript = nix-update-script {}; 42 43 meta = with lib; { 44 description = "Extremely fast CSS parser, transformer, and minifier written in Rust";
+3
pkgs/by-name/py/pyprland/package.nix
··· 2 lib, 3 fetchFromGitHub, 4 python3Packages, 5 }: 6 7 python3Packages.buildPythonApplication rec { ··· 56 "pyprland.plugins.toggle_special" 57 "pyprland.plugins.workspaces_follow_focus" 58 ]; 59 60 meta = { 61 mainProgram = "pypr";
··· 2 lib, 3 fetchFromGitHub, 4 python3Packages, 5 + nix-update-script, 6 }: 7 8 python3Packages.buildPythonApplication rec { ··· 57 "pyprland.plugins.toggle_special" 58 "pyprland.plugins.workspaces_follow_focus" 59 ]; 60 + 61 + passthru.updateScript = nix-update-script {}; 62 63 meta = { 64 mainProgram = "pypr";
+4
pkgs/common-updater/unstable-updater.nix
··· 8 9 # This is an updater for unstable packages that should always use the latest 10 # commit. 11 { url ? null # The git url, if empty it will be set to src.gitRepoUrl 12 , branch ? null 13 , hardcodeZeroVersion ? false # Use a made-up version "0" instead of latest tag. Use when there is no previous release, or the project's tagging system is incompatible with what we expect from versions
··· 8 9 # This is an updater for unstable packages that should always use the latest 10 # commit. 11 + # To use this updater, add the following to your package set: 12 + # passthru.updateScript = unstableGitUpdater { }; 13 + # relevant attributes can be passed as below: 14 + 15 { url ? null # The git url, if empty it will be set to src.gitRepoUrl 16 , branch ? null 17 , hardcodeZeroVersion ? false # Use a made-up version "0" instead of latest tag. Use when there is no previous release, or the project's tagging system is incompatible with what we expect from versions
+2 -10
pkgs/tools/filesystems/bcachefs-tools/default.nix
··· 20 rustc, 21 rustPlatform, 22 makeWrapper, 23 - writeScript, 24 python3, 25 fuseSupport ? false, 26 }: ··· 104 inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti; 105 }; 106 107 - updateScript = writeScript "update-bcachefs-tools-and-cargo-lock.sh" '' 108 - #!/usr/bin/env nix-shell 109 - #!nix-shell -i bash -p curl jq common-updater-scripts 110 - res="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ 111 - -sL "https://api.github.com/repos/${finalAttrs.src.owner}/${finalAttrs.src.repo}/tags?per_page=1")" 112 - 113 - version="$(echo $res | jq '.[0].name | split("v") | .[1]' --raw-output)" 114 - update-source-version ${finalAttrs.pname} "$version" --ignore-same-hash 115 - ''; 116 }; 117 118 enableParallelBuilding = true;
··· 20 rustc, 21 rustPlatform, 22 makeWrapper, 23 + nix-update-script, 24 python3, 25 fuseSupport ? false, 26 }: ··· 104 inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti; 105 }; 106 107 + updateScript = nix-update-script {}; 108 }; 109 110 enableParallelBuilding = true;