aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/programs/ncmpcpp/ncmpcpp-example-settings.nix
blob: 02a1f09c9027f7cb09557fe2acf834615a336625 (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
{ pkgs, ... }:

{
  config = {
    programs.ncmpcpp = {
      enable = true;
      mpdMusicDir = "/home/user/music";

      settings = {
        user_interface = "alternative";
        display_volume_level = false;
        playlist_disable_highlight_delay = 0;
      };

      bindings = [
        {
          key = "j";
          command = "scroll_down";
        }
        {
          key = "k";
          command = "scroll_up";
        }
        {
          key = "J";
          command = [ "select_item" "scroll_down" ];
        }
        {
          key = "K";
          command = [ "select_item" "scroll_up" ];
        }
        {
          key = "x";
          command = "delete_playlist_items";
        }
        {
          key = "x";
          command = "delete_browser_items";
        }
        {
          key = "x";
          command = "delete_stored_playlist";
        }
      ];
    };

    nixpkgs.overlays =
      [ (self: super: { ncmpcpp = pkgs.writeScriptBin "dummy-ncmpcpp" ""; }) ];

    nmt.script = ''
      assertFileContent \
        home-files/.config/ncmpcpp/config \
        ${./ncmpcpp-example-settings-expected-config}

      assertFileContent \
        home-files/.config/ncmpcpp/bindings \
        ${./ncmpcpp-example-settings-expected-bindings}
    '';
  };
}