fix(docker): get correct path for volume data
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-14 16:09:55 -05:00
parent 948fbf943e
commit 2c095bfbc5
2 changed files with 9 additions and 6 deletions

View file

@ -3,6 +3,7 @@
config, config,
lib, lib,
pkgs, pkgs,
self,
... ...
} @ inputs: } @ inputs:
with lib; with lib;
@ -57,9 +58,11 @@ in {
backend = "docker"; backend = "docker";
projects = let projects = let
basePath = "${self}/devices/${config.vars.hostName}/modules/arion";
composeFiles = composeFiles =
filter (n: hasSuffix "compose.nix" (toString n)) filter (n: hasSuffix "compose.nix" (toString n))
(filesystem.listFilesRecursive ./.); (filesystem.listFilesRecursive basePath);
projects = filterAttrs (n: v: v.enabled or true) (listToAttrs (map (p: { projects = filterAttrs (n: v: v.enabled or true) (listToAttrs (map (p: {
name = elemAt (match ".*\/(.*)\/compose\.nix" (toString p)) 0; name = elemAt (match ".*\/(.*)\/compose\.nix" (toString p)) 0;
@ -70,7 +73,7 @@ in {
rwPath = rwPath =
configPath configPath
+ "/" + "/"
+ elemAt (match "[^-]*-(.*)" "${dirOf p}") 0; + removePrefix basePath "${dirOf p}";
}); });
}) })
composeFiles)); composeFiles));

View file

@ -10,8 +10,8 @@
restart = "always"; restart = "always";
volumes = [ volumes = [
"${rwPath}/data/be/config.txt:/app/config.txt:ro" "${rwPath}/be/config.txt:/app/config.txt:ro"
"${rwPath}/data/be/playlists:/app/playlists:rw" "${rwPath}/be/playlists:/app/playlists:rw"
]; ];
}; };
@ -21,8 +21,8 @@
restart = "always"; restart = "always";
volumes = [ volumes = [
"${rwPath}/data/br/config.txt:/app/config.txt:ro" "${rwPath}/br/config.txt:/app/config.txt:ro"
"${rwPath}/data/br/playlists:/app/playlists:rw" "${rwPath}/br/playlists:/app/playlists:rw"
]; ];
}; };
}; };