about summary refs log tree commit diff
path: root/pkgs/larbs-music/default.nix
blob: 8e9169cfbb5528259d2b870fb3f71a15584cc3a3 (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
{ stdenv, buildEnv, makeWrapper, makeDesktopItem, callPackage, ncmpcpp, libnotify }:
with stdenv.lib;

let
  pname = "larbs-music";
  version = "1.0";
  voidrice = callPackage ../voidrice.nix { };
  config = "${voidrice}/.config/ncmpcpp/config";
  bindings = "${voidrice}/.config/ncmpcpp/config";
  vizNcmpcpp = ncmpcpp.override {
    visualizerSupport = true;
  };

  ncmpcppWrapped = stdenv.mkDerivation {
    inherit pname version;
    unpackPhase = "true";

    buildInputs = [ makeWrapper ];

    installPhase = ''
      makeWrapper ${vizNcmpcpp}/bin/ncmpcpp $out/bin/ncmpcpp \
      --add-flags "-c ${config}" \
      --add-flags "-b ${bindings}"
    '';

  };

  desktopItem = makeDesktopItem {
    name = pname;
    genericName = "Music player";
    comment = "Ncmpcpp music player configuration by Luke Smith";
    exec = "${ncmpcppWrapped}/bin/ncmpcpp";
    # icon =
    desktopName = pname;
    categories = "Audio;AudioVideo";
    terminal = "true";
  };

in
  buildEnv {
    name = pname;

    paths = [
      ncmpcppWrapped
      libnotify
      desktopItem
    ];

    meta = {
      homepage = "https://github.com/LukeSmithXYZ/voidrice";
      description = "NCMPCPP music player with vim bindings";
      license = licenses.gpl3;
      platforms = [ "x86_64-linux" "x86_64-darwin" ];
    };
  }