switched navidrome to podman
This commit is contained in:
parent
460511b9cd
commit
80f62467d9
1 changed files with 35 additions and 19 deletions
|
|
@ -1,39 +1,55 @@
|
||||||
{ ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
|
cfg = import ./vars.nix;
|
||||||
domain = "music.mc-fucker.cool";
|
domain = "music.mc-fucker.cool";
|
||||||
|
port = cfg.navidrome.port;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
#nixpkgs.config.packageOverrides = pkgs:
|
imports = [
|
||||||
#{
|
./nginx.nix
|
||||||
# navidrome = pkgs.callPackage ../packages/navidrome {};
|
];
|
||||||
#};
|
|
||||||
|
|
||||||
services.navidrome = {
|
sops.secrets."navidrome" = {};
|
||||||
enable = true;
|
|
||||||
settings = {
|
virtualisation.oci-containers.containers.navidrome = {
|
||||||
MusicFolder = "/mnt/genc/Musik";
|
image = "docker.io/deluan/navidrome";
|
||||||
|
environment = {
|
||||||
|
TZ = "Europe/Berlin";
|
||||||
|
ND_SESSIONTIMEOUT = "336h";
|
||||||
};
|
};
|
||||||
|
environmentFiles = [ config.sops.secrets.navidrome.path ];
|
||||||
|
ports = [
|
||||||
|
"${port}:${port}"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"/var/lib/navidrome:/data"
|
||||||
|
"/mnt/mergerfs/media/music:/music:ro"
|
||||||
|
];
|
||||||
|
extraOptions = cfg.podman.extraOptions;
|
||||||
|
autoStart = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."${domain}" = {
|
services.nginx.virtualHosts."${domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:4533";
|
proxyPass = "http://127.0.0.1:${port}";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-Protocol $scheme;
|
||||||
|
proxy_set_header X-Forwarded-Host $http_host;
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
access_log /var/log/nginx/${domain}_access.log;
|
access_log /var/log/nginx/${domain}_access.log;
|
||||||
error_log /var/log/nginx/${domain}_error.log;
|
error_log /var/log/nginx/${domain}_error.log;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
systemd.services.navidrome = {
|
|
||||||
# fixes failing DNS lookup
|
|
||||||
serviceConfig.BindReadOnlyPaths = [ "/etc" ];
|
|
||||||
after = [ "genc_mount.service" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = "5s";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
# vim: set et ts=2 sw=2 ai:
|
# vim: set et ts=2 sw=2 ai:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue