style(nixos): name navidrome guest configs
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
serviceConfig = config.containers.navidrome.config.modules.services.navidrome;
|
||||
guestCfg = config.guests.navidrome;
|
||||
serviceCfg = config.containers.navidrome.config.modules.services.navidrome;
|
||||
lastfmApiKeySecret = "services/navidrome/lastfm/api-key";
|
||||
lastfmSecretSecret = "services/navidrome/lastfm/secret";
|
||||
hostSecrets = ../secrets + "/${config.networking.hostName}.yaml";
|
||||
@@ -26,14 +27,14 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.guests.navidrome.enable {
|
||||
config = lib.mkIf guestCfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.guests.navidrome.dataPath != null;
|
||||
assertion = guestCfg.dataPath != null;
|
||||
message = "guests.navidrome.dataPath must point at the host directory that stores Navidrome data.";
|
||||
}
|
||||
{
|
||||
assertion = config.guests.navidrome.libraryPath != null;
|
||||
assertion = guestCfg.libraryPath != null;
|
||||
message = "guests.navidrome.libraryPath must point at the host directory that stores Navidrome's library folder.";
|
||||
}
|
||||
];
|
||||
@@ -42,19 +43,19 @@ in
|
||||
interior.modules.services.navidrome.enable = true;
|
||||
|
||||
mounts = {
|
||||
${serviceConfig.dataFolder} = {
|
||||
directory = config.guests.navidrome.dataPath;
|
||||
${serviceCfg.dataFolder} = {
|
||||
directory = guestCfg.dataPath;
|
||||
owner = config.registry."stable-uid".${config.networking.hostName}.navidrome;
|
||||
group = "storage";
|
||||
mode = "2770";
|
||||
};
|
||||
${serviceConfig.musicFolder} = {
|
||||
directory = config.guests.navidrome.libraryPath;
|
||||
${serviceCfg.musicFolder} = {
|
||||
directory = guestCfg.libraryPath;
|
||||
owner = "root";
|
||||
group = "storage";
|
||||
mode = "2770";
|
||||
};
|
||||
${serviceConfig.environmentFile} = {
|
||||
${serviceCfg.environmentFile} = {
|
||||
file = config.sops.templates."navidrome.env".path;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user