summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-06-15 18:10:30 +0200
committerMinijackson <minijackson@riseup.net>2021-06-15 18:10:30 +0200
commita0be1f92584a4d3904e754f9dbd284554bd98381 (patch)
tree2c8ac8e8701fd350f96d2ca046f41985f78d4f74
parent9eef958cd0df0c2d87910d70e1e8344dff988070 (diff)
downloadnixos-config-reborn-a0be1f92584a4d3904e754f9dbd284554bd98381.tar.gz
nixos-config-reborn-a0be1f92584a4d3904e754f9dbd284554bd98381.zip
music: init
-rw-r--r--flake.nix6
-rw-r--r--usecases/desktop/music.nix149
2 files changed, 154 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index f05befc..bd27419 100644
--- a/flake.nix
+++ b/flake.nix
@@ -70,6 +70,7 @@
70 default = (import ./usecases/desktop/default.nix inputs); 70 default = (import ./usecases/desktop/default.nix inputs);
71 71
72 development = (import ./usecases/desktop/development.nix inputs); 72 development = (import ./usecases/desktop/development.nix inputs);
73 music = (import ./usecases/desktop/music.nix inputs);
73 networkManager = (import ./usecases/desktop/networking/network-manager.nix inputs); 74 networkManager = (import ./usecases/desktop/networking/network-manager.nix inputs);
74 }; 75 };
75 76
@@ -124,18 +125,21 @@
124 ]; 125 ];
125 }; 126 };
126 127
127 testDevDesktop = nixpkgs.lib.nixosSystem { 128 testFullDesktop = nixpkgs.lib.nixosSystem {
128 system = "x86_64-linux"; 129 system = "x86_64-linux";
129 modules = [ 130 modules = [
130 self.nixosModules.test 131 self.nixosModules.test
131 self.nixosModules.profiles.desktop 132 self.nixosModules.profiles.desktop
132 self.nixosModules.usecases.desktop.development 133 self.nixosModules.usecases.desktop.development
134 self.nixosModules.usecases.desktop.music
133 135
134 ({ modulesPath, ... }: { 136 ({ modulesPath, ... }: {
135 imports = [ 137 imports = [
136 (modulesPath + "/virtualisation/qemu-vm.nix") 138 (modulesPath + "/virtualisation/qemu-vm.nix")
137 ]; 139 ];
138 140
141 home-manager.users.minijackson.programs.beets.settings.acoustid.apikey = "0000000000";
142
139 virtualisation.memorySize = 2048; 143 virtualisation.memorySize = 2048;
140 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ]; 144 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
141 }) 145 })
diff --git a/usecases/desktop/music.nix b/usecases/desktop/music.nix
new file mode 100644
index 0000000..d21f0eb
--- /dev/null
+++ b/usecases/desktop/music.nix
@@ -0,0 +1,149 @@
1inputs:
2
3{ config, pkgs, ... }:
4
5{
6 assertions = [
7 {
8 assertion =
9 config.home-manager.users.minijackson.programs.beets.settings ? acoustid &&
10 config.home-manager.users.minijackson.programs.beets.settings.acoustid ? apikey &&
11 config.home-manager.users.minijackson.programs.beets.settings.acoustid.apikey != null;
12 message = "Please provide the API key for the Acoustid database";
13 }
14 ];
15
16 services.mpd = {
17 enable = true;
18 musicDirectory = "/home/minijackson/Music";
19 user = "minijackson";
20 group = "users";
21
22 extraConfig = ''
23 audio_output {
24 type "pulse"
25 name "PulseAudio"
26 server "127.0.0.1"
27 }
28
29 audio_output {
30 type "fifo"
31 name "Fifo"
32 path "/tmp/mpd.fifo"
33 format "44100:16:2"
34 }
35 '';
36
37 startWhenNeeded = true;
38 };
39
40 home-manager.users.minijackson = { ... }:
41 {
42 programs.beets = {
43 enable = true;
44
45 package = pkgs.beets.override {
46 # Python SoCo failed to build
47 enableSonosUpdate = false;
48 };
49
50 settings = {
51 plugins = [
52 "absubmit"
53 "acousticbrainz"
54 "badfiles"
55 "chroma"
56 "convert"
57 "edit"
58 "export"
59 "fetchart"
60 "fromfilename"
61 "lastgenre"
62 "mbsubmit"
63 "mbsync"
64 "missing"
65 "mpdupdate"
66 "random"
67 "the"
68 "zero"
69 ];
70 lastgenre = {
71 canonical = true;
72 # High count due to canonicalization which removes fetched genres
73 count = 6;
74 };
75 paths = {
76 default = "%the{$albumartist}/%the{$album}%aunique{}/$track $title";
77 singleton = "Non-Album/%the{$artist}/%the{$title}";
78 comp = "Compilations/%the{$album}%aunique{}/$track $title";
79 };
80 zero.fields = "comments";
81 };
82 };
83
84 programs.ncmpcpp = {
85 enable = true;
86 package = pkgs.ncmpcpp.override {
87 outputsSupport = true;
88 visualizerSupport = true;
89 };
90 mpdMusicDir = "/home/minijackson/Music";
91 settings = {
92 visualizer_data_source = "/tmp/mpd.fifo";
93 visualizer_output_name = "FIFO";
94 visualizer_in_stereo = true;
95 visualizer_type = "ellipse";
96 visualizer_look = "▒▒";
97 visualizer_color = "cyan, blue, magenta, red, yellow, green";
98
99 user_interface = "alternative";
100
101 media_library_primary_tag = "album_artist";
102
103 display_bitrate = true;
104
105 #----------------------------------------------------
106 # file: ~/.ncmpcpp/config
107 # author: jason ryan - http://jasonwryan.com/
108 #----------------------------------------------------
109
110 mpd_connection_timeout = "5";
111 playlist_disable_highlight_delay = "3";
112 message_delay_time = "4";
113 header_visibility = true;
114 statusbar_visibility = true;
115 song_list_format = "{%a - }{%t}|{$5%f$9}$R{$7(%l)$9}";
116 song_status_format = "$2%a $1• $3%t $1• $4%b {(Disc %d) }$1• $5%y$1";
117 song_window_title_format = "Ncmpcpp: {%a - }{%t}|{%f}";
118 song_columns_list_format = "(7f)[white]{n} (33)[cyan]{t} (20)[green]{a} (20)[magenta]{b} (10)[magenta]{y} (7f)[white]{l}";
119 playlist_display_mode = "columns";
120 browser_display_mode = "columns";
121 titles_visibility = true;
122 progressbar_look = "─╼·";
123 # media_library_left_column = "a" (possible values: a,y,g,c,p, legend above)
124 header_text_scrolling = true;
125 # fancy_scrolling = true;
126 display_remaining_time = true;
127 ignore_leading_the = true;
128 empty_tag_marker = "";
129 enable_window_title = true;
130 colors_enabled = true;
131 header_window_color = "magenta";
132 volume_color = "green";
133 state_line_color = "yellow";
134 state_flags_color = "blue";
135 main_window_color = "cyan";
136 color1 = "cyan";
137 color2 = "blue";
138
139 current_item_prefix = "$(cyan)$r";
140 current_item_suffix = "$/r$(end)";
141
142 progressbar_color = "yellow";
143 statusbar_color = "cyan";
144
145 # active_column_color = "cyan";
146 };
147 };
148 };
149}