summaryrefslogtreecommitdiffstats
path: root/usecases/desktop
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2024-08-04 17:56:03 +0200
committerMinijackson <minijackson@riseup.net>2024-08-04 18:00:41 +0200
commit326d2622c1bb67e2f5b9654f0d626fc752cce1d0 (patch)
tree298a9a7a86e1a025699c804be3cf663b8f5acf85 /usecases/desktop
parent782e61ea00fb81092cd05b949d6db885b30506dc (diff)
downloadnixos-config-reborn-326d2622c1bb67e2f5b9654f0d626fc752cce1d0.tar.gz
nixos-config-reborn-326d2622c1bb67e2f5b9654f0d626fc752cce1d0.zip
usecases/music: remove mpd, adapt sway keybindings
Diffstat (limited to 'usecases/desktop')
-rw-r--r--usecases/desktop/music.nix212
1 files changed, 57 insertions, 155 deletions
diff --git a/usecases/desktop/music.nix b/usecases/desktop/music.nix
index 7d5706b..a988601 100644
--- a/usecases/desktop/music.nix
+++ b/usecases/desktop/music.nix
@@ -1,166 +1,68 @@
1_inputs: { 1_inputs:
2 config, 2{
3 lib, 3 lib,
4 pkgs, 4 pkgs,
5 ... 5 ...
6}: { 6}:
7 assertions = [ 7{
8 {
9 assertion =
10 config.home-manager.users.minijackson.programs.beets.settings
11 ? acoustid
12 && config.home-manager.users.minijackson.programs.beets.settings.acoustid ? apikey
13 && config.home-manager.users.minijackson.programs.beets.settings.acoustid.apikey != null;
14 message = "Please provide the API key for the Acoustid database";
15 }
16 ];
17
18 services.mpd = {
19 enable = true;
20 musicDirectory = "/home/minijackson/Music";
21 user = "minijackson";
22 group = "users";
23
24 extraConfig = ''
25 audio_output {
26 type "pulse"
27 name "PulseAudio"
28 server "127.0.0.1"
29 }
30
31 audio_output {
32 type "fifo"
33 name "Fifo"
34 path "/tmp/mpd.fifo"
35 format "44100:16:2"
36 }
37 '';
38
39 #startWhenNeeded = true;
40 };
41
42 users.extraUsers.minijackson.packages = [ 8 users.extraUsers.minijackson.packages = [
43 (pkgs.writeScriptBin 9 (pkgs.writeScriptBin "split-cue" (builtins.readFile ../../res/scripts/split-cue.sh))
44 "split-cue"
45 (builtins.readFile ../../res/scripts/split-cue.sh))
46 ]; 10 ];
47 11
48 home-manager.users.minijackson = {config, ...}: { 12 home-manager.users.minijackson =
49 programs.beets = { 13 { config, ... }:
50 enable = true; 14 {
51 15 programs.beets = {
52 settings = { 16 enable = true;
53 plugins = [ 17
54 "absubmit" 18 settings = {
55 "badfiles" 19 plugins = [
56 "chroma" 20 "absubmit"
57 "convert" 21 "badfiles"
58 "edit" 22 "chroma"
59 "export" 23 "convert"
60 "fetchart" 24 "edit"
61 "fromfilename" 25 "export"
62 "lastgenre" 26 "fetchart"
63 "mbsubmit" 27 "fromfilename"
64 "mbsync" 28 "lastgenre"
65 "missing" 29 "mbsubmit"
66 "mpdupdate" 30 "mbsync"
67 "parentwork" 31 "missing"
68 "random" 32 "mpdupdate"
69 "the" 33 "parentwork"
70 "zero" 34 "random"
71 ]; 35 "the"
72 lastgenre = { 36 "zero"
73 canonical = true; 37 ];
74 # High count due to canonicalization which removes fetched genres 38 lastgenre = {
75 count = 6; 39 canonical = true;
76 }; 40 # High count due to canonicalization which removes fetched genres
77 paths = { 41 count = 6;
78 default = "%the{$albumartist}/%the{$album}%aunique{}/$track $title"; 42 };
79 singleton = "Non-Album/%the{$artist}/%the{$title}"; 43 paths = {
80 comp = "Compilations/%the{$album}%aunique{}/$track $title"; 44 default = "%the{$albumartist}/%the{$album}%aunique{}/$track $title";
45 singleton = "Non-Album/%the{$artist}/%the{$title}";
46 comp = "Compilations/%the{$album}%aunique{}/$track $title";
47 };
48 zero.fields = "comments";
81 }; 49 };
82 zero.fields = "comments";
83 };
84 };
85
86 programs.ncmpcpp = {
87 enable = true;
88 package = pkgs.ncmpcpp.override {
89 outputsSupport = true;
90 visualizerSupport = true;
91 }; 50 };
92 mpdMusicDir = "/home/minijackson/Music";
93 settings = {
94 visualizer_data_source = "/tmp/mpd.fifo";
95 visualizer_output_name = "FIFO";
96 visualizer_in_stereo = true;
97 visualizer_type = "ellipse";
98 visualizer_look = "▒▒";
99 visualizer_color = "cyan, blue, magenta, red, yellow, green";
100 51
101 user_interface = "alternative"; 52 wayland.windowManager.sway.config.keybindings =
102 53 let
103 media_library_primary_tag = "album_artist"; 54 inherit (config.wayland.windowManager.sway.config) modifier;
104 55 playerctl = lib.getExe pkgs.playerctl;
105 display_bitrate = true; 56 in
106 57 lib.mkOptionDefault {
107 #---------------------------------------------------- 58 "XF86AudioPlay" = "exec ${playerctl} play-pause";
108 # file: ~/.ncmpcpp/config 59 "XF86AudioPrev" = "exec ${playerctl} previous";
109 # author: jason ryan - http://jasonwryan.com/ 60 "XF86AudioNext" = "exec ${playerctl} next";
110 #---------------------------------------------------- 61
111 62 "${modifier}+KP_5" = "exec ${playerctl} play-pause";
112 mpd_connection_timeout = "5"; 63 "${modifier}+KP_4" = "exec ${playerctl} previous";
113 playlist_disable_highlight_delay = "3"; 64 "${modifier}+KP_6" = "exec ${playerctl} next";
114 message_delay_time = "4"; 65 "${modifier}+KP_8" = "exec ${playerctl} stop";
115 header_visibility = true; 66 };
116 statusbar_visibility = true;
117 song_list_format = "{%a - }{%t}|{$5%f$9}$R{$7(%l)$9}";
118 song_status_format = "$2%a $1• $3%t $1• $4%b {(Disc %d) }$1• $5%y$1";
119 song_window_title_format = "Ncmpcpp: {%a - }{%t}|{%f}";
120 song_columns_list_format = "(7f)[white]{n} (33)[cyan]{t} (20)[green]{a} (20)[magenta]{b} (10)[magenta]{y} (7f)[white]{l}";
121 playlist_display_mode = "columns";
122 browser_display_mode = "columns";
123 titles_visibility = true;
124 progressbar_look = "─╼·";
125 # media_library_left_column = "a" (possible values: a,y,g,c,p, legend above)
126 header_text_scrolling = true;
127 # fancy_scrolling = true;
128 display_remaining_time = true;
129 ignore_leading_the = true;
130 empty_tag_marker = "";
131 enable_window_title = true;
132 colors_enabled = true;
133 header_window_color = "magenta";
134 volume_color = "green";
135 state_line_color = "yellow";
136 state_flags_color = "blue";
137 main_window_color = "cyan";
138 color1 = "cyan";
139 color2 = "blue";
140
141 current_item_prefix = "$(cyan)$r";
142 current_item_suffix = "$/r$(end)";
143
144 progressbar_color = "yellow";
145 statusbar_color = "cyan";
146
147 # active_column_color = "cyan";
148 };
149 }; 67 };
150
151 wayland.windowManager.sway.config.keybindings = let
152 inherit (config.wayland.windowManager.sway.config) modifier;
153 mpc = "${pkgs.mpc_cli}/bin/mpc";
154 in
155 lib.mkOptionDefault {
156 "XF86AudioPlay" = "exec ${mpc} toggle";
157 "XF86AudioPrev" = "exec ${mpc} prev";
158 "XF86AudioNext" = "exec ${mpc} next";
159
160 "${modifier}+KP_5" = "exec ${mpc} toggle";
161 "${modifier}+KP_4" = "exec ${mpc} prev";
162 "${modifier}+KP_6" = "exec ${mpc} next";
163 "${modifier}+KP_8" = "exec ${mpc} stop";
164 };
165 };
166} 68}