added assertion for jellyfin persistence
This commit is contained in:
parent
72322b0544
commit
194287e22a
|
@ -5,6 +5,8 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
jellyfinPort = 8096;
|
jellyfinPort = 8096;
|
||||||
|
jellyfin_data_directory = "/var/lib/jellyfin";
|
||||||
|
jellyfin_cache_directory = "/var/cache/jellyfin";
|
||||||
in {
|
in {
|
||||||
options.host.jellyfin = {
|
options.host.jellyfin = {
|
||||||
enable = lib.mkEnableOption "should jellyfin be enabled on this computer";
|
enable = lib.mkEnableOption "should jellyfin be enabled on this computer";
|
||||||
|
@ -29,14 +31,23 @@ in {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf config.host.impermanence.enable {
|
(lib.mkIf config.host.impermanence.enable {
|
||||||
# TODO: add an assertion here that directories matches jellyfin directories
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.services.jellyfin.dataDir == jellyfin_data_directory;
|
||||||
|
description = "jellyfin data directory does not match persistence";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = config.services.jellyfin.cacheDir == jellyfin_cache_directory;
|
||||||
|
description = "jellyfin cache directory does not match persistence";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
environment.persistence."/persist/system/jellyfin" = {
|
environment.persistence."/persist/system/jellyfin" = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hideMounts = true;
|
hideMounts = true;
|
||||||
directories = [
|
directories = [
|
||||||
"/var/lib/jellyfin"
|
jellyfin_data_directory
|
||||||
"/var/cache/jellyfin"
|
jellyfin_cache_directory
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue