summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/misc/deadd-notification-center/default.nix
blob: dda967a113e1797981e7dc669f2a9ad78bbf87c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
  mkDerivation,
  haskellPackages,
  fetchFromGitHub,
  lib,
}:

let
  # deadd-notification-center.service
  systemd-service = ''
    [Unit]
    Description=Deadd Notification Center
    PartOf=graphical-session.target

    [Service]
    Type=dbus
    BusName=org.freedesktop.Notifications
    ExecStart=$out/bin/deadd-notification-center

    [Install]
    WantedBy=graphical-session.target
  '';
in
mkDerivation rec {
  pname = "deadd-notification-center";
  version = "2.1.1";

  src = fetchFromGitHub {
    owner = "phuhl";
    repo = "linux_notification_center";
    rev = version;
    hash = "sha256-VU9NaQVS0n8hFRjWMvCMkaF5mZ4hpnluV31+/SAK7tU=";
  };

  isLibrary = false;

  isExecutable = true;

  libraryHaskellDepends = with haskellPackages; [
    aeson
    base
    bytestring
    ConfigFile
    containers
    dbus
    directory
    env-locale
    filepath
    gi-cairo
    gi-gdk
    gi-gdkpixbuf
    gi-gio
    gi-glib
    gi-gobject
    gi-gtk
    gi-pango
    haskell-gettext
    haskell-gi
    haskell-gi-base
    hdaemonize
    here
    lens
    mtl
    process
    regex-tdfa
    setlocale
    split
    stm
    tagsoup
    text
    time
    transformers
    tuple
    unix
    yaml
  ];

  executableHaskellDepends = with haskellPackages; [ base ];

  # Test suite does nothing.
  doCheck = false;

  postPatch = ''
    substituteInPlace src/NotificationCenter.hs \
      --replace '/etc/xdg/deadd/deadd.css' "$out/etc/deadd.css"
  '';

  # Add systemd user unit and install default style.
  postInstall = ''
    mkdir -p $out/lib/systemd/user
    install -Dm644 style.css $out/etc/deadd.css
    echo "${systemd-service}" > $out/lib/systemd/user/deadd-notification-center.service
  '';

  description = "Haskell-written notification center for users that like a desktop with style";
  homepage = "https://github.com/phuhl/linux_notification_center";
  license = lib.licenses.bsd3;
  maintainers = with lib.maintainers; [
    melkor333
    sna
  ];
  platforms = lib.platforms.linux;
  mainProgram = "deadd-notification-center";
}