summary refs log tree commit diff
path: root/nixos/tests/minidlna.nix
diff options
context:
space:
mode:
authorAntoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>2019-03-07 11:29:25 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2019-09-17 19:51:33 +0200
commit35fe50352fa4ea295fda43e429b4581533e48af4 (patch)
tree7f5484b5ee388bfb4905088ce0ae7c18d6623b13 /nixos/tests/minidlna.nix
parent446dd2543d8be0d53c30166133dd964a5340e214 (diff)
downloadnixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.tar
nixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.tar.gz
nixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.tar.bz2
nixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.tar.lz
nixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.tar.xz
nixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.tar.zst
nixpkgs-35fe50352fa4ea295fda43e429b4581533e48af4.zip
nixos/minidlna: Allow more configuration options
This commits allows the user to configure:
- more minidlna options
- the ones not yet disclosed in nix (extending the existing minimal subset)
Diffstat (limited to 'nixos/tests/minidlna.nix')
-rw-r--r--nixos/tests/minidlna.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixos/tests/minidlna.nix b/nixos/tests/minidlna.nix
new file mode 100644
index 00000000000..7bf1bed69d0
--- /dev/null
+++ b/nixos/tests/minidlna.nix
@@ -0,0 +1,39 @@
+import ./make-test.nix ({ pkgs, ... }: {
+  name = "minidlna";
+
+  nodes = {
+    server =
+      { ... }:
+      {
+        imports = [ ../modules/profiles/minimal.nix ];
+        networking.firewall.allowedTCPPorts = [ 8200 ];
+        services.minidlna = {
+          enable = true;
+          loglevel = "error";
+          mediaDirs = [
+           "PV,/tmp/stuff"
+          ];
+          friendlyName = "rpi3";
+          rootContainer = "B";
+          extraConfig =
+          ''
+            album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg
+            album_art_names=AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg
+            album_art_names=Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
+            notify_interval=60
+          '';
+        };
+      };
+      client = { ... }: { };
+  };
+
+  testScript =
+  ''
+    startAll;
+    $server->succeed("mkdir -p /tmp/stuff && chown minidlna: /tmp/stuff");
+    $server->waitForUnit("minidlna");
+    $server->waitForOpenPort("8200");
+    $server->succeed("curl --fail http://localhost:8200/");
+    $client->succeed("curl --fail http://server:8200/");
+  '';
+})