From 18ec46c773b0f4496daebf9cd6f010a45cddae29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Mon, 6 Mar 2023 11:44:16 +0100 Subject: [PATCH] feat(flix): update --- configs/flix.nix | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/configs/flix.nix b/configs/flix.nix index f42377e..19d2f65 100644 --- a/configs/flix.nix +++ b/configs/flix.nix @@ -4,14 +4,16 @@ ... }: let flixLocation = "/media/flix"; + flixLocationNew = "/media/flix-new"; cacheLocation = "/var/cache/flix"; indexFilename = "index"; + indexFilenameNew = "index-new"; flixUser = "flix"; flixGroup = "users"; inherit (import ../lib) tmpfilesConfig; in { fileSystems.${flixLocation} = { - device = "prism.r:/export"; + device = "prism.r:/export/download"; fsType = "nfs"; options = [ "noauto" @@ -26,6 +28,20 @@ in { ]; }; + fileSystems.${flixLocationNew} = { + device = "//yellow.r/public"; + fsType = "cifs"; + options = [ + "guest" + "nofail" + "noauto" + "ro" + "x-systemd.automount" + "x-systemd.device-timeout=1" + "x-systemd.idle-timeout=1min" + ]; + }; + systemd.tmpfiles.rules = [ (tmpfilesConfig { type = "d"; @@ -39,7 +55,10 @@ in { systemd.services.flix-index = { description = "Flix indexing service"; wants = ["network-online.target"]; - script = "cp ${flixLocation}/download/index ./${indexFilename}"; + script = '' + cp ${flixLocation}/index ./${indexFilename} + cp ${flixLocationNew}/index ./${indexFilenameNew} + ''; startAt = "hourly"; serviceConfig = { Type = "oneshot"; @@ -69,11 +88,10 @@ in { '') (pkgs.writers.writeDashBin "flixmenu" '' set -efu - cd "${flixLocation}/download" + cd "${flixLocation}" - [ -f "${cacheLocation}/${indexFilename}" ] || exit 1 - - ${pkgs.dmenu}/bin/dmenu -i -p flix -l 5 "$@" < ${cacheLocation}/${indexFilename} \ + cat ${cacheLocation}/${indexFilename} ${cacheLocation}/${indexFilenameNew} \ + | ${pkgs.dmenu}/bin/dmenu -i -p flix -l 5 "$@" \ | ${pkgs.findutils}/bin/xargs -I '{}' ${pkgs.util-linux}/bin/setsid ${pkgs.xdg-utils}/bin/xdg-open '{}' '') ];