mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-15 17:50:53 +00:00
mpd: add extraArgs
(#3735)
Allow passing arguments to the MPD command line. Currently the only interesting one is `--verbose`.
This commit is contained in:
parent
b9e3a29864
commit
3c18113bd7
5 changed files with 23 additions and 4 deletions
|
@ -92,6 +92,15 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
extraArgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "--verbose" ];
|
||||
description = ''
|
||||
Extra command-line arguments to pass to MPD.
|
||||
'';
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "${config.xdg.dataHome}/${name}";
|
||||
|
@ -176,7 +185,9 @@ in {
|
|||
|
||||
Service = {
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${cfg.package}/bin/mpd --no-daemon ${mpdConf}";
|
||||
ExecStart = "${cfg.package}/bin/mpd --no-daemon ${mpdConf} ${
|
||||
escapeShellArgs cfg.extraArgs
|
||||
}";
|
||||
Type = "notify";
|
||||
ExecStartPre = ''
|
||||
${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"'';
|
||||
|
|
|
@ -6,6 +6,7 @@ with lib;
|
|||
services.mpd = {
|
||||
enable = true;
|
||||
musicDirectory = "/my/music/dir";
|
||||
extraArgs = [ "--verbose" ];
|
||||
};
|
||||
|
||||
home.stateVersion = "22.11";
|
||||
|
|
|
@ -3,7 +3,7 @@ WantedBy=default.target
|
|||
|
||||
[Service]
|
||||
Environment=PATH=/home/hm-user/.nix-profile/bin
|
||||
ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf
|
||||
ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf '--verbose'
|
||||
ExecStartPre=/nix/store/00000000000000000000000000000000-bash/bin/bash -c "/nix/store/00000000000000000000000000000000-coreutils/bin/mkdir -p '/home/hm-user/.local/share/mpd' '/home/hm-user/.local/share/mpd/playlists'"
|
||||
Type=notify
|
||||
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
with lib;
|
||||
|
||||
{
|
||||
services.mpd.enable = true;
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
extraArgs = [ "--verbose" ];
|
||||
};
|
||||
|
||||
home.stateVersion = "18.09";
|
||||
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
with lib;
|
||||
|
||||
{
|
||||
services.mpd.enable = true;
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
extraArgs = [ "--verbose" ];
|
||||
};
|
||||
|
||||
xdg.userDirs.enable = true;
|
||||
|
||||
home.stateVersion = "22.11";
|
||||
|
|
Loading…
Reference in a new issue