summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorAndreas Rammhold <andreas@rammhold.de>2018-06-01 19:39:17 +0200
committerGitHub <noreply@github.com>2018-06-01 19:39:17 +0200
commitbc069622dde963680f3e71c24f96a6fd32ed412e (patch)
tree5de672dbc24769d0b742ea48d03164ebf14cb127 /nixos
parent44659fcbe162b8dbce50df6fc32ca63637e2f9ca (diff)
parenta0797bad2c9ea3781367703bb603ab21e5d64d3e (diff)
downloadnixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.tar
nixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.tar.gz
nixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.tar.bz2
nixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.tar.lz
nixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.tar.xz
nixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.tar.zst
nixlib-bc069622dde963680f3e71c24f96a6fd32ed412e.zip
Merge pull request #41367 from andir/nixos-mpd-dbFile-null
nixos/mpd: allow services.mpd.dbFile to be null
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/audio/mpd.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix
index 5f379b392ea8..500a9e35a13b 100644
--- a/nixos/modules/services/audio/mpd.nix
+++ b/nixos/modules/services/audio/mpd.nix
@@ -13,7 +13,9 @@ let
   mpdConf = pkgs.writeText "mpd.conf" ''
     music_directory     "${cfg.musicDirectory}"
     playlist_directory  "${cfg.playlistDirectory}"
-    db_file             "${cfg.dbFile}"
+    ${lib.optionalString (cfg.dbFile != null) ''
+      db_file             "${cfg.dbFile}"
+    ''}
     state_file          "${cfg.dataDir}/state"
     sticker_file        "${cfg.dataDir}/sticker.sql"
     log_file            "syslog"
@@ -126,11 +128,12 @@ in {
       };
 
       dbFile = mkOption {
-        type = types.str;
+        type = types.nullOr types.str;
         default = "${cfg.dataDir}/tag_cache";
         defaultText = ''''${dataDir}/tag_cache'';
         description = ''
-          The path to MPD's database.
+          The path to MPD's database. If set to <literal>null</literal> the
+          paramter is omitted from the configuration.
         '';
       };
     };