New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deadd-notification-center: init at 1.7.2 #89118
Conversation
a123bb2
to
33deb2f
Compare
I've got a couple suggestions. I'll post after eating |
I am very inexperienced with haskell, but it seems like this might help with that stack problem |
33deb2f
to
b4c71f3
Compare
@IvarWithoutBones phuhl/linux_notification_center#28 the nix section for stack is supposed to be added. Even then I'm not sure how to package with stack compilation. I can try it with |
b4c71f3
to
1a7accb
Compare
Seems like you're right, my bad. Looking around the repo it indeed never seems to be used, i just thought it might fix the issue when posting that comment 😅 |
{ stdenv, lib, fetchurl, autoPatchelfHook | ||
, gtk3, gobject-introspection, libxml2 }: | ||
|
||
let | ||
dbusService = fetchurl { | ||
url = "https://github.com/phuhl/linux_notification_center/raw/master/com.ph-uhl.deadd.notification.service.in"; | ||
sha256 = "0jvmi1c98hm8x1x7kw9ws0nbf4y56yy44c3bqm6rjj4lrm89l83s"; | ||
}; | ||
in | ||
stdenv.mkDerivation rec { | ||
|
||
pname = "linux_notification_center"; | ||
version = "1.7.2"; | ||
|
||
src = fetchurl { | ||
url = "https://github.com/phuhl/linux_notification_center/releases/download/${version}/deadd-notification-center"; | ||
sha256 = "13f15slkjiw2n5dnqj13dprhqm3nf1k11jqaqda379yhgygyp9zm"; | ||
}; | ||
|
||
dontUnpack = true; | ||
|
||
nativeBuildInputs = [ autoPatchelfHook ]; | ||
|
||
buildInputs = [ | ||
gtk3 | ||
gobject-introspection | ||
libxml2 | ||
]; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp $src $out/bin/deadd-notification-center | ||
chmod +x $out/bin/deadd-notification-center | ||
|
||
mkdir -p $out/share/dbus-1/services | ||
sed "s|##PREFIX##|$out|g" ${dbusService} > $out/share/dbus-1/services/com.ph-uhl.deadd.notification.service | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A notification daemon/center for linux"; | ||
homepage = https://github.com/phuhl/linux_notification_center; | ||
license = licenses.bsd3; | ||
maintainers = [ maintainers.pacman99 ]; | ||
platforms = platforms.linux; | ||
}; | ||
} |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
1a7accb
to
c639f7c
Compare
@06kellyjac Thank you! I took all the suggestions, but added a bit of opinionated white spacing ;) |
I tried building from source here: https://github.com/Pacman99/nixpkgs/blob/notification-center-fromsource/pkgs/applications/misc/linux-notification-center/default.nix I can't get it to build, it outputs: |
c639f7c
to
01c2ddc
Compare
Every haskell package I can think of searching for is in the |
Here's something I was trying based on carp: { lib
, fetchFromGitHub
, haskellPackages
, pango
, cairo
, gtk3
, gobject-introspection
, libxml2
}:
haskellPackages.mkDerivation rec {
pname = "linux-notification-center";
version = "1.7.2";
src = fetchFromGitHub {
owner = "phuhl";
repo = builtins.replaceStrings ["-"] ["_"] pname;
rev = version;
sha256 = "1j3j9m7hhrq9jk95kpf458dimy08xp7nxd47na6nmcvybdv4kgq8";
};
buildDepends = [
# cairo
pango
gtk3
gobject-introspection
libxml2
];
executableHaskellDepends = with haskellPackages; [
ConfigFile
cairo
dbus
gi-gdk
gi-gdkpixbuf
gi-gio
gi-gtk
gtk3
hdaemonize
here
hgettext
lens
setlocale
system-locale
tuple
];
isExecutable = true;
description = "A notification daemon/center for linux";
homepage = https://github.com/phuhl/linux_notification_center;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ pacman99 ];
platforms = lib.platforms.linux;
} but system-locale is broken so I didn't get past there. Seems like Also I only found one other package using |
This is a nifty line you can keep for if you get it building from source: or it might be useless, as it might be better to package it as |
01c2ddc
to
184241e
Compare
Makes sense to me, I renamed everything.
Wow that looks great! Without the broken system-locale, it would probably work. Not sure how to test that theory though. From source would be nice, but I'll keep it as a binary package for now, because of the time issue. I think it makes sense, since that is how the author released the program. Maybe if they release it to hackage it can packaged with that or as a haskell derivation if the time issue is fixed.
Thats cool, I might be able to use that somewhere else
The hackage taskell is marked as broken, so I guess that is why the separate derivation was created. |
Hi Pacman99, thanks for your work. I couldn't wait for this to be merged and built your expression locally without modifications. Everything works fine with an exception of notifications with icons, e.g. Spotify.
Manually adding the I'm very new to Nix/NixOS, but my thinking is that this |
Tested locally on Sway after rebasing on latest master and it worked fine. Here's the patch for diff --git a/pkgs/applications/misc/deadd-notification-center/default.nix b/pkgs/applications/misc/deadd-notification-center/default.nix
index 98fe799b110..ed5100d722a 100644
--- a/pkgs/applications/misc/deadd-notification-center/default.nix
+++ b/pkgs/applications/misc/deadd-notification-center/default.nix
@@ -1,9 +1,11 @@
{ stdenv
, fetchurl
, autoPatchelfHook
+, wrapGAppsHook
, gtk3
, gobject-introspection
, libxml2
+, hicolor-icon-theme
}:
let
@@ -25,12 +27,16 @@ stdenv.mkDerivation rec {
dontUnpack = true;
- nativeBuildInputs = [ autoPatchelfHook ];
+ nativeBuildInputs = [
+ autoPatchelfHook
+ wrapGAppsHook
+ ];
buildInputs = [
gtk3
gobject-introspection
libxml2
+ hicolor-icon-theme
];
installPhase = ''
@@ -38,7 +44,7 @@ stdenv.mkDerivation rec {
cp $src $out/bin/deadd-notification-center
chmod +x $out/bin/deadd-notification-center
- sed "s|##PREFIX##|$out|g" ${dbusService} > $out/share/dbus-1/services/com.ph-uhl.deadd.notification.service
+ sed "s|##PREFIX##|$out|g" ${dbusService} > $out/share/dbus-1/services/com.ph-uhl.deadd.notification.service
'';
meta = with stdenv.lib; {
Locally tested deadd-notification-center and Spotify with the following commands: $ nix-shell --pure -I nixpkgs=<PATH-TO-LOCAL-NIXPKGS> -p deadd-notification-center dbus --run "dbus-run-session -- bash -c 'echo \$DBUS_SESSION_BUS_ADDRESS; deadd-notification-center'" &
unix:abstract=/tmp/dbus-0VyhuZqAYs,guid=long-string
[nix-shell:~]$ DBUS_SESSION_BUS_ADDRESS="<copy-paste result above>" spotify & Note that processes are not killed upon leaving the shell and must be manually killed. Spotify's icon is still missing (which is expected since there is no icon theme in the pure shell in $XDG_DATA_DIRS) but the warning disappears. |
Result of 1 package built:
|
It's a damn cool software, let's not make perfect be in the way of good, this can be iteratively improved. It passes nixpkgs-review here. |
random question: I would love to have a toggle to show the center in systray. Anyone with a snippet ? |
thanks I am using i3pystatus + i3bar so that's doable. Endgame would be to have a counter too so I will track phuhl/linux_notification_center#34. |
@noreferences thats a nice polybar config. Is the one in your nix-config repo up to date? |
Yep |
Thanks for merging! Sorry I didn't respond to some of the comments, I didn't get much time to work on this. I can send in a PR later for the icon themes as @berbiche and @noreferences suggested. Also If the errors from system-locale and time in haskellPackges gets fixed at some point, I'd like to get this building from source. But till then this expression works pretty well. |
Thanks for merging ! I've been looking forward to this for some time ! @teto I have a binding in my i3 config for |
Motivation for this change
Adds linux_notification-center, a notification daemon that also provides a toggle for a notification center
https://github.com/phuhl/linux_notification_center
I could not figure out how to compile from source. Stack tried to create a directory in '/' when compiling. The binary was much easier to package, so I chose to do that and get just the dbus service file from the github repository.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)