main
1{lib, ...}: {
2 flake.modules.nixos.desktop = {pkgs, ...}: {
3 environment.plasma6.excludePackages = with pkgs.kdePackages; [
4 elisa # Using deadbeef instead.
5 ];
6 };
7
8 flake.modules.homeManager.desktop = {pkgs, ...}: {
9 programs.deadbeef =
10 lib.mkIf
11 pkgs.stdenv.hostPlatform.isLinux
12 (let
13 lyricbar = pkgs.stdenv.mkDerivation {
14 pname = "deadbeef-lyricbar-plugin-modified";
15 version = "unstable-2024-10-24";
16 src = pkgs.fetchFromGitHub {
17 owner = "wind-mask";
18 repo = "deadbeef-lyricbar";
19 rev = "b28f9c9cafd9200db8fb8f0639ab44d23042bc39";
20 sha256 = "Nho9aF6SiqtkdIgXQ0FCM89wGM9VFIA25sfIffHIoZ8=";
21 };
22 nativeBuildInputs = [pkgs.pkg-config];
23 buildInputs = with pkgs; [
24 deadbeef
25 gtkmm3
26 curl
27 taglib_1
28 ];
29 NIX_CFLAGS_COMPILE = "-Wno-incompatible-pointer-types";
30 buildFlags = ["gtk3"];
31 meta = {platforms = lib.platforms.linux;};
32 };
33 in {
34 # enable = true;
35 package = pkgs.deadbeef-with-plugins;
36 plugins = with pkgs.deadbeefPlugins; [
37 mpris2
38 lyricbar
39 ];
40 settings = {
41 close_send_to_tray = 1;
42 "gtkui.override_bar_colors" = 1;
43 "lyricbar.backgroundcolor" = "#24273a";
44 "lyricbar.highlightcolor" = "#c6a0f6";
45 "lyricbar.regularcolor" = "#cad3f5";
46 "junk.enable_cp936_detection" = 1;
47 gtkui.layout = {
48 type = "hsplitter";
49 legacy_params = " locked=2 ratio=0.76 pos=0 size2=360";
50 children = [
51 {
52 type = "vbox";
53 legacy_params = " expand=\"1 0\" fill=\"1 1\" homogeneous=0";
54 children = [
55 {
56 type = "hsplitter";
57 legacy_params = " locked=0 ratio=0.25 pos=0 size2=0";
58 children = [
59 {
60 type = "vsplitter";
61 legacy_params = " locked=0 ratio=0.5 pos=0 size2=0";
62 children = [
63 {type = "medialibviewer";}
64 {type = "pltbrowser";}
65 ];
66 }
67 {
68 type = "playlist";
69 legacy_params = " hideheaders=0 width=604";
70 }
71 ];
72 }
73 {
74 type = "hbox";
75 legacy_params = " expand=\"0 1 0\" fill=\"0 1 0\" homogeneous=0";
76 children = [
77 {type = "playtb";}
78 {type = "seekbar";}
79 {
80 type = "volumebar";
81 settings = {
82 scale = "db";
83 };
84 }
85 ];
86 }
87 ];
88 }
89 {
90 type = "vsplitter";
91 legacy_params = " locked=2 ratio=0.9 pos=0 size2=90";
92 children = [
93 {
94 type = "vsplitter";
95 legacy_params = " locked=1 ratio=0.48 pos=360 size2=0";
96 children = [
97 {
98 type = "coverart";
99 settings.mode = "selected";
100 }
101 {type = "lyricbar";}
102 ];
103 }
104 {
105 type = "spectrum";
106 settings = {
107 renderMode = "bands";
108 distanceBetweenBars = "3";
109 barGranularity = "2";
110 };
111 }
112 ];
113 }
114 ];
115 };
116 gtkui.columns.playlist = [
117 {
118 title = "♫";
119 id = "1";
120 format = "%playstatus%";
121 sort_format = "";
122 size = "30";
123 align = "0";
124 color_override = "0";
125 color = "#ff000000";
126 }
127 {
128 title = "标题";
129 id = "-1";
130 format = "%title%";
131 sort_format = "";
132 size = "250";
133 align = "0";
134 color_override = "0";
135 color = "#ff000000";
136 }
137 {
138 title = "艺人";
139 id = "-1";
140 format = "$if(%artist%,%artist%,未知艺术家)";
141 sort_format = "";
142 size = "200";
143 align = "0";
144 color_override = "0";
145 color = "#ff000000";
146 }
147 {
148 title = "专辑";
149 id = "-1";
150 format = "%album%";
151 sort_format = "";
152 size = "250";
153 align = "0";
154 color_override = "0";
155 color = "#ff000000";
156 }
157 ];
158 };
159 });
160 };
161}