From 38fe18dcd3780e67bf64dc51b3f8827c9139d87d Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Tue, 15 Aug 2023 07:59:31 -0300 Subject: [PATCH] debianutils: refactor - one parameter per line - use rec-less, overlay-style overridable recursive attributes (in effect since https://github.com/NixOS/nixpkgs/pull/119942) - remove references to pname - use hash instead of sha256 - multiple outputs - remove with nesting (following https://nix.dev/anti-patterns/language#with-attrset-expression) - format meta - add myself as maintainer --- pkgs/tools/misc/debianutils/default.nix | 33 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/misc/debianutils/default.nix b/pkgs/tools/misc/debianutils/default.nix index 58a05bc4d42e..4f5055cdc155 100644 --- a/pkgs/tools/misc/debianutils/default.nix +++ b/pkgs/tools/misc/debianutils/default.nix @@ -1,24 +1,33 @@ -{ lib, stdenv, fetchurl }: +{ lib +, stdenv +, fetchurl +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "debianutils"; version = "5.8"; src = fetchurl { - url = "mirror://debian/pool/main/d/${pname}/${pname}_${version}.orig.tar.gz"; - sha256 = "sha256-WwhtJ+uQY95NdGdg0PrrQNlGT7hV/IqOf7k7A+/OxiI="; + url = "mirror://debian/pool/main/d/debianutils/debianutils_${finalAttrs.version}.orig.tar.gz"; + hash = "sha256-WwhtJ+uQY95NdGdg0PrrQNlGT7hV/IqOf7k7A+/OxiI="; }; - meta = with lib; { + outputs = [ "out" "man" ]; + + meta = { + homepage = "https://packages.debian.org/sid/debianutils"; description = "Miscellaneous utilities specific to Debian"; longDescription = '' - This package provides a number of small utilities which are used primarily by the installation scripts of Debian packages, although you may use them directly. + This package provides a number of small utilities which are used + primarily by the installation scripts of Debian packages, although you + may use them directly. - The specific utilities included are: add-shell installkernel ischroot remove-shell run-parts savelog tempfile which + The specific utilities included are: add-shell installkernel ischroot + remove-shell run-parts savelog tempfile which ''; - downloadPage = "https://packages.debian.org/sid/debianutils"; - license = with licenses; [ gpl2Plus publicDomain smail ]; - maintainers = []; - platforms = platforms.all; + license = with lib.licenses; [ gpl2Plus publicDomain smail ]; + mainProgram = "ischroot"; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.all; }; -} +})