forked from nix-community/home-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mpd: use XDG music dir if XDG user dirs are enabled
If the user has enabled the XDG user directories module then we can use the XDG music directory in the MPD module. Otherwise we'll leave the option undefined so that the user is forced to define the directory to use. This applies to state version 22.11 and above. Fixes nix-community#3225
- Loading branch information
Showing
10 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
{ | ||
services.mpd.enable = true; | ||
|
||
home.stateVersion = "18.09"; | ||
|
||
test.stubs.mpd = { }; | ||
|
||
nmt.script = '' | ||
serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/mpd.service) | ||
assertFileContent "$serviceFile" ${./basic-configuration.service} | ||
confFile=$(grep -o \ | ||
'/nix/store/.*-mpd.conf' \ | ||
$TESTED/home-files/.config/systemd/user/mpd.service) | ||
assertFileContains \ | ||
"$confFile" \ | ||
'music_directory "/home/hm-user/music"' | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
{ mpd-basic-configuration = ./basic-configuration.nix; } | ||
{ | ||
mpd-basic-configuration = ./basic-configuration.nix; | ||
mpd-before-state-version-22_11 = ./before-state-version-22_11.nix; | ||
mpd-xdg-music-dir = ./xdg-music-dir.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
music_directory "/home/hm-user/Music" | ||
playlist_directory "/home/hm-user/.local/share/mpd/playlists" | ||
db_file "/home/hm-user/.local/share/mpd/tag_cache" | ||
|
||
state_file "/home/hm-user/.local/share/mpd/state" | ||
sticker_file "/home/hm-user/.local/share/mpd/sticker.sql" | ||
|
||
bind_to_address "127.0.0.1" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
{ | ||
services.mpd.enable = true; | ||
xdg.userDirs.enable = true; | ||
|
||
home.stateVersion = "22.11"; | ||
|
||
test.stubs.mpd = { }; | ||
|
||
nmt.script = '' | ||
serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/mpd.service) | ||
assertFileContent "$serviceFile" ${./basic-configuration.service} | ||
confFile=$(grep -o \ | ||
'/nix/store/.*-mpd.conf' \ | ||
$TESTED/home-files/.config/systemd/user/mpd.service) | ||
assertFileContent "$confFile" ${./xdg-music-dir.conf} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters