mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01: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 {
|
dataDir = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "${config.xdg.dataHome}/${name}";
|
default = "${config.xdg.dataHome}/${name}";
|
||||||
|
@ -176,7 +185,9 @@ in {
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
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";
|
Type = "notify";
|
||||||
ExecStartPre = ''
|
ExecStartPre = ''
|
||||||
${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"'';
|
${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"'';
|
||||||
|
|
|
@ -6,6 +6,7 @@ with lib;
|
||||||
services.mpd = {
|
services.mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
musicDirectory = "/my/music/dir";
|
musicDirectory = "/my/music/dir";
|
||||||
|
extraArgs = [ "--verbose" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
home.stateVersion = "22.11";
|
home.stateVersion = "22.11";
|
||||||
|
|
|
@ -3,7 +3,7 @@ WantedBy=default.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=PATH=/home/hm-user/.nix-profile/bin
|
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'"
|
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
|
Type=notify
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
services.mpd.enable = true;
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
extraArgs = [ "--verbose" ];
|
||||||
|
};
|
||||||
|
|
||||||
home.stateVersion = "18.09";
|
home.stateVersion = "18.09";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
services.mpd.enable = true;
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
extraArgs = [ "--verbose" ];
|
||||||
|
};
|
||||||
|
|
||||||
xdg.userDirs.enable = true;
|
xdg.userDirs.enable = true;
|
||||||
|
|
||||||
home.stateVersion = "22.11";
|
home.stateVersion = "22.11";
|
||||||
|
|
Loading…
Reference in a new issue