From ece89eabe57ca74b908392b74661330a2222f35c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 11:45:25 +0100 Subject: [PATCH 1/4] rates: refactor - use hash - add changelog to meta --- pkgs/tools/misc/rates/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/rates/default.nix b/pkgs/tools/misc/rates/default.nix index c774721eeecc..5bcb6898b7e9 100644 --- a/pkgs/tools/misc/rates/default.nix +++ b/pkgs/tools/misc/rates/default.nix @@ -11,9 +11,9 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "lunush"; - repo = pname; - rev = version; - sha256 = "sha256-zw2YLTrvqbGKR8Dg5W+kJTDKIfro+MNyjHXfZMXZhaw="; + repo = "rates"; + rev = "refs/tags/${version}"; + hash = "sha256-zw2YLTrvqbGKR8Dg5W+kJTDKIfro+MNyjHXfZMXZhaw="; }; cargoHash = "sha256-5EcTeMfa1GNp1q60qSgEi/I3298hXUD1Vc1K55XGW4I="; @@ -23,6 +23,7 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "CLI tool that brings currency exchange rates right into your terminal"; homepage = "https://github.com/lunush/rates"; + changelog = "https://github.com/lunush/rates/releases/tag/${version}"; license = with licenses; [ asl20 /* or */ mit ]; maintainers = with maintainers; [ fab ]; mainProgram = "rates"; From a72e7d1cd29ba801da1d989d98d88d81f6295b4c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 11:46:01 +0100 Subject: [PATCH 2/4] rates:format with nixfmt --- pkgs/tools/misc/rates/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/misc/rates/default.nix b/pkgs/tools/misc/rates/default.nix index 5bcb6898b7e9..25cf21c5f59d 100644 --- a/pkgs/tools/misc/rates/default.nix +++ b/pkgs/tools/misc/rates/default.nix @@ -1,8 +1,9 @@ -{ lib -, stdenv -, fetchFromGitHub -, rustPlatform -, Security +{ + lib, + stdenv, + fetchFromGitHub, + rustPlatform, + Security, }: rustPlatform.buildRustPackage rec { @@ -24,7 +25,10 @@ rustPlatform.buildRustPackage rec { description = "CLI tool that brings currency exchange rates right into your terminal"; homepage = "https://github.com/lunush/rates"; changelog = "https://github.com/lunush/rates/releases/tag/${version}"; - license = with licenses; [ asl20 /* or */ mit ]; + license = with licenses; [ + asl20 + mit + ]; maintainers = with maintainers; [ fab ]; mainProgram = "rates"; }; From 51adde8e757de222348b337000eac5827c6a8e22 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 11:47:59 +0100 Subject: [PATCH 3/4] rates: add versionCheckHook --- pkgs/tools/misc/rates/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/misc/rates/default.nix b/pkgs/tools/misc/rates/default.nix index 25cf21c5f59d..1056f184ae06 100644 --- a/pkgs/tools/misc/rates/default.nix +++ b/pkgs/tools/misc/rates/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, rustPlatform, Security, + versionCheckHook, }: rustPlatform.buildRustPackage rec { @@ -21,6 +22,12 @@ rustPlatform.buildRustPackage rec { buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; + nativeInstallCheckInputs = [ versionCheckHook ]; + + doInstallCheck = true; + + versionCheckProgramArg = [ "--version" ]; + meta = with lib; { description = "CLI tool that brings currency exchange rates right into your terminal"; homepage = "https://github.com/lunush/rates"; From 5061e5448d555b415d60bb27d4f2414e577ee2cf Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 3 Dec 2024 11:50:49 +0100 Subject: [PATCH 4/4] rates: move to pkgs/by-name --- .../misc/rates/default.nix => by-name/ra/rates/package.nix} | 4 ++-- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) rename pkgs/{tools/misc/rates/default.nix => by-name/ra/rates/package.nix} (89%) diff --git a/pkgs/tools/misc/rates/default.nix b/pkgs/by-name/ra/rates/package.nix similarity index 89% rename from pkgs/tools/misc/rates/default.nix rename to pkgs/by-name/ra/rates/package.nix index 1056f184ae06..3360f3961666 100644 --- a/pkgs/tools/misc/rates/default.nix +++ b/pkgs/by-name/ra/rates/package.nix @@ -1,9 +1,9 @@ { lib, stdenv, + darwin, fetchFromGitHub, rustPlatform, - Security, versionCheckHook, }: @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-5EcTeMfa1GNp1q60qSgEi/I3298hXUD1Vc1K55XGW4I="; - buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; + buildInputs = lib.optional stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ]; nativeInstallCheckInputs = [ versionCheckHook ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e6d18c1a3849..1cfb18202e80 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18512,10 +18512,6 @@ with pkgs; qzdl = libsForQt5.callPackage ../games/qzdl { }; - rates = callPackage ../tools/misc/rates { - inherit (darwin.apple_sdk.frameworks) Security; - }; - rbspy = darwin.apple_sdk_11_0.callPackage ../development/tools/rbspy { }; pick-colour-picker = python3Packages.callPackage ../applications/graphics/pick-colour-picker {