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.
ncmpcpp: Allow
str
type values for mpdMusicDir
option
The default value of `programs.ncmpcpp.mpdMusicDir` is taken from `services.mpd.musicDirectory` if the mpd module is enabled, which has type `either path str`. `programs.ncmpcpp.mpdMusicDir` did not accept `str` values, though, so an error was raised when the default value was used and `services.mpd.musicDirectory` was set to a value of type `str`. This commit changes the type of `programs.ncmpcpp.mpdMusicDir` to also accept `str` to reflect the type of `services.mpd.musicDirectory`. Fixes nix-community#3560
- Loading branch information
1 parent
54245e1
commit b1e7cdd
Showing
4 changed files
with
32 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
{ ncmpcpp-use-mpd-config = ./ncmpcpp-use-mpd-config.nix; } | ||
{ | ||
ncmpcpp-use-mpd-config = ./ncmpcpp-use-mpd-config.nix; | ||
ncmpcpp-issue-3560 = ./ncmpcpp-issue-3560.nix; | ||
} |
1 change: 1 addition & 0 deletions
1
tests/modules/programs/ncmpcpp-linux/ncmpcpp-issue-3560-expected-config
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 @@ | ||
mpd_music_dir=~/music |
25 changes: 25 additions & 0 deletions
25
tests/modules/programs/ncmpcpp-linux/ncmpcpp-issue-3560.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,25 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
config = { | ||
# Minimal config reproducing | ||
# https://github.com/nix-community/home-manager/issues/3560 | ||
programs.ncmpcpp.enable = true; | ||
|
||
services.mpd.enable = true; | ||
services.mpd.musicDirectory = "~/music"; | ||
|
||
test.stubs = { | ||
ncmpcpp = { }; | ||
mpd = { }; | ||
}; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/.config/ncmpcpp/config \ | ||
${./ncmpcpp-issue-3560-expected-config} | ||
assertPathNotExists home-files/.config/ncmpcpp/bindings | ||
''; | ||
}; | ||
} |