From ebb4d8a13f5f73d878543ad94d1b4c557c6f7a08 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Mon, 21 Aug 2023 08:50:54 -0300 Subject: [PATCH] zig-shell-completions: refactor - Use rec-less, overlay-style overridable recursive attributes (in effect since https://github.com/NixOS/nixpkgs/pull/119942); - Remove nested with (according to https://nix.dev/anti-patterns/language#with-attrset-expression); - Add updateScript. --- .../compilers/zig/shell-completions.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/zig/shell-completions.nix b/pkgs/development/compilers/zig/shell-completions.nix index 74beb5f63d6..db76250bf80 100644 --- a/pkgs/development/compilers/zig/shell-completions.nix +++ b/pkgs/development/compilers/zig/shell-completions.nix @@ -2,9 +2,10 @@ , stdenv , fetchFromGitHub , installShellFiles +, unstableGitUpdater }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "zig-shell-completions"; version = "unstable-2023-08-17"; @@ -29,11 +30,13 @@ stdenv.mkDerivation rec { runHook postInstall ''; - meta = with lib; { + passthru.updateScript = unstableGitUpdater { }; + + meta = { homepage = "https://github.com/ziglang/shell-completions"; description = "Shell completions for the Zig compiler"; - license = licenses.mit; - maintainers = with maintainers; [ aaronjheng ]; - platforms = platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aaronjheng ]; + platforms = lib.platforms.all; }; -} +})