From 18e78c0770312d99a41bdee449d2aec3795f5e51 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 14 Aug 2024 10:23:53 -0700 Subject: [PATCH 1/2] qrtool: nixfmt --- pkgs/by-name/qr/qrtool/package.nix | 38 +++++++++++++++++------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/qr/qrtool/package.nix b/pkgs/by-name/qr/qrtool/package.nix index ffdf0ac82538..4fb17b7ca8dc 100644 --- a/pkgs/by-name/qr/qrtool/package.nix +++ b/pkgs/by-name/qr/qrtool/package.nix @@ -1,9 +1,10 @@ -{ lib -, stdenv -, fetchFromGitHub -, rustPlatform -, asciidoctor -, installShellFiles +{ + lib, + stdenv, + fetchFromGitHub, + rustPlatform, + asciidoctor, + installShellFiles, }: rustPlatform.buildRustPackage rec { @@ -19,18 +20,23 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-lR/LusIgdA+G7YeSLHjxdcC96tOSqSyalVamS42ORs0="; - nativeBuildInputs = [ asciidoctor installShellFiles ]; + nativeBuildInputs = [ + asciidoctor + installShellFiles + ]; - postInstall = '' - # Built by ./build.rs using `asciidoctor` - installManPage ./target/*/release/build/qrtool*/out/*.? + postInstall = + '' + # Built by ./build.rs using `asciidoctor` + installManPage ./target/*/release/build/qrtool*/out/*.? - '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd qrtool \ - --bash <($out/bin/qrtool --generate-completion bash) \ - --fish <($out/bin/qrtool --generate-completion fish) \ - --zsh <($out/bin/qrtool --generate-completion zsh) - ''; + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd qrtool \ + --bash <($out/bin/qrtool --generate-completion bash) \ + --fish <($out/bin/qrtool --generate-completion fish) \ + --zsh <($out/bin/qrtool --generate-completion zsh) + ''; meta = with lib; { maintainers = with maintainers; [ philiptaron ]; From 24bf96e2570aa8e9d67a85bc6fd46fd48c1ca287 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 14 Aug 2024 10:25:31 -0700 Subject: [PATCH 2/2] qrtool: switch to GitLab source --- pkgs/by-name/qr/qrtool/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/qr/qrtool/package.nix b/pkgs/by-name/qr/qrtool/package.nix index 4fb17b7ca8dc..8748c58c376b 100644 --- a/pkgs/by-name/qr/qrtool/package.nix +++ b/pkgs/by-name/qr/qrtool/package.nix @@ -1,7 +1,7 @@ { lib, stdenv, - fetchFromGitHub, + fetchFromGitLab, rustPlatform, asciidoctor, installShellFiles, @@ -11,11 +11,11 @@ rustPlatform.buildRustPackage rec { pname = "qrtool"; version = "0.11.4"; - src = fetchFromGitHub { + src = fetchFromGitLab { owner = "sorairolake"; repo = "qrtool"; rev = "v${version}"; - sha256 = "sha256-lD/xi2k5baZGUUixy/032jTBevr0uQIT/JmX+d+kPyA="; + hash = "sha256-lD/xi2k5baZGUUixy/032jTBevr0uQIT/JmX+d+kPyA="; }; cargoHash = "sha256-lR/LusIgdA+G7YeSLHjxdcC96tOSqSyalVamS42ORs0=";