lol

nsxiv: improve

- finalAttrs
- multiple outputs
- no nested with

+12 -10
+12 -10
pkgs/by-name/ns/nsxiv/package.nix
··· 10 10 , conf ? null 11 11 }: 12 12 13 - stdenv.mkDerivation rec { 13 + stdenv.mkDerivation (finalAttrs: { 14 14 pname = "nsxiv"; 15 15 version = "31"; 16 16 ··· 18 18 domain = "codeberg.org"; 19 19 owner = "nsxiv"; 20 20 repo = "nsxiv"; 21 - rev = "v${version}"; 21 + rev = "v${finalAttrs.version}"; 22 22 hash = "sha256-X1ZMr5OADs9GIe/kp/kEqKMMHZMymd58m9+f0SPzn7s="; 23 23 }; 24 + 25 + outputs = [ "out" "man" "doc" ]; 24 26 25 27 buildInputs = [ 26 28 giflib ··· 30 32 libwebp 31 33 ] ++ lib.optional stdenv.isDarwin libinotify-kqueue; 32 34 33 - preBuild = lib.optionalString (conf!=null) '' 35 + postPatch = lib.optionalString (conf != null) '' 34 36 cp ${(builtins.toFile "config.def.h" conf)} config.def.h 35 37 ''; 36 38 37 - NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-linotify"; 39 + env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-linotify"; 38 40 39 41 makeFlags = [ "CC:=$(CC)" ]; 40 42 ··· 42 44 43 45 installTargets = [ "install-all" ]; 44 46 45 - meta = with lib; { 47 + meta = { 46 48 homepage = "https://nsxiv.codeberg.page/"; 47 49 description = "New Suckless X Image Viewer"; 48 50 longDescription = '' ··· 59 61 - Display image information in status bar 60 62 - Display image name/path in X title 61 63 ''; 62 - license = licenses.gpl2Plus; 63 - maintainers = with maintainers; [ AndersonTorres sikmir ]; 64 - platforms = platforms.unix; 65 - changelog = "https://codeberg.org/nsxiv/nsxiv/src/tag/${src.rev}/etc/CHANGELOG.md"; 64 + changelog = "https://codeberg.org/nsxiv/nsxiv/src/tag/${finalAttrs.src.rev}/etc/CHANGELOG.md"; 65 + license = lib.licenses.gpl2Plus; 66 + maintainers = with lib.maintainers; [ AndersonTorres sikmir ]; 67 + platforms = lib.platforms.unix; 66 68 }; 67 - } 69 + })