diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 5507855992ee..e6217f96d6ab 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -11667,6 +11667,12 @@ name = "Silvan Mosberger"; keys = [ { fingerprint = "6C2B 55D4 4E04 8266 6B7D DA1A 422E 9EDA E015 7170"; } ]; }; + iniw = { + email = "git@vini.cat"; + github = "iniw"; + githubId = 30220881; + name = "Vinicius Deolindo"; + }; insipx = { email = "github@andrewplaza.dev"; github = "insipx"; diff --git a/pkgs/by-name/li/linear/package.nix b/pkgs/by-name/li/linear/package.nix new file mode 100644 index 000000000000..a0c8816a50bd --- /dev/null +++ b/pkgs/by-name/li/linear/package.nix @@ -0,0 +1,48 @@ +{ + lib, + stdenvNoCC, + fetchurl, + _7zz, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "linear"; + version = "1.30.2"; + + src = fetchurl { + url = "https://releases.linear.app/Linear-${finalAttrs.version}-universal.dmg"; + hash = "sha256-udtN7sOnbT1B684q/JhPFGq8mYvhc5CbTxuJi6NYFac="; + }; + + strictDeps = true; + __structuredAttrs = true; + + nativeBuildInputs = [ _7zz ]; + + sourceRoot = "Linear"; + + # -snld prevents "ERROR: Dangerous symbolic link path was ignored". + # -xr'!*:com.apple.*' prevents macOS extended attributes from being + # extracted as regular files, which corrupts the .app bundle. + unpackCmd = "7zz x -snld -xr'!*:com.apple.*' $curSrc"; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/Applications" + cp -R Linear.app "$out/Applications" + + runHook postInstall + ''; + + passthru.updateScript = ./update.sh; + + meta = { + description = "App to manage software development and track bugs"; + homepage = "https://linear.app/"; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ iniw ]; + platforms = lib.platforms.darwin; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + }; +}) diff --git a/pkgs/by-name/li/linear/update.sh b/pkgs/by-name/li/linear/update.sh new file mode 100755 index 000000000000..c6ee30c2ac3a --- /dev/null +++ b/pkgs/by-name/li/linear/update.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p coreutils curl gnugrep common-updater-scripts +#shellcheck shell=bash + +set -eu -o pipefail + +source_url="https://releases.linear.app/mac" + +version="$(curl -L -I "$source_url" | grep -ioE 'filename="Linear-[0-9]+(\.[0-9]+)*-universal\.dmg"' | grep -oE '[0-9]+(\.[0-9]+)*')" + +if [[ -z $version ]]; then + echo "Could not find the latest Linear version in release headers" >&2 + exit 1 +fi + +hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$(nix-prefetch-url --type sha256 "https://releases.linear.app/Linear-${version}-universal.dmg")") + +update-source-version linear "$version" "$hash" --ignore-same-version