Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions pkgs/applications/networking/ssb/patchwork/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ appimageTools, symlinkJoin, lib, fetchurl, makeDesktopItem }:
{ appimageTools, stdenvNoCC, lib, fetchurl, makeDesktopItem
, wrapGAppsHook, gsettings-desktop-schemas, gtk3 }:

let
pname = "ssb-patchwork";
Expand Down Expand Up @@ -29,16 +30,20 @@ let
categories = "Network;";
};

in
symlinkJoin {
inherit name;
paths = [ binary ];
in stdenvNoCC.mkDerivation {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really get why we have to use the NoCC version here? It has little benefit.

inherit pname version;

postBuild = ''
mkdir -p $out/share/pixmaps/ $out/share/applications
cp ${appimage-contents}/ssb-patchwork.png $out/share/pixmaps
cp ${desktopItem}/share/applications/* $out/share/applications/
'';
nativeBuildInputs = [ wrapGAppsHook ];

buildCommand = ''
makeWrapper "${binary}/bin/ssb-patchwork" "$out/bin/ssb-patchwork" \
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}" \
Comment on lines +36 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an improper use of wrapGAppsHook.
Please read https://nixos.org/nixpkgs/manual/#ssec-gnome-hooks, it exists so you don't have to do this.

It also should automatically wrap everything at $out/bin. If you make a symlink here for ${binary}/bin/ssb-patchwork $out/bin/ssb-patchwork you shouldn't have to do anything.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer an automatic solution but it doesn't work here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why? If you can't you can just use the makeWrapper with the arguments wrapGAppsHook collects "${gappsWrapperArgs[@]}".


mkdir -p $out/share/pixmaps/ $out/share/applications
cp ${appimage-contents}/ssb-patchwork.png $out/share/pixmaps
cp ${desktopItem}/share/applications/* $out/share/applications/
'';

meta = with lib; {
description = "A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB)";
Expand All @@ -47,7 +52,12 @@ in
'';
homepage = "https://www.scuttlebutt.nz/";
license = licenses.agpl3;
maintainers = with maintainers; [ asymmetric ninjatrappeur thedavidmeister ];
maintainers = with maintainers; [
asymmetric
ninjatrappeur
thedavidmeister
ehmry
];
platforms = [ "x86_64-linux" ];
};
}