update prestart with script
This commit is contained in:
parent
79cbd4b1a8
commit
2a2bb52729
1 changed files with 8 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
|
@ -33,14 +34,14 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStartPre = ''
|
ExecStartPre = "${pkgs.writeShellScript "scrypted-start-pre" ''
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
podman rm -f ${app} || true
|
podman rm -f ${app} || true
|
||||||
rm -f /run/${app}.ctr-id
|
rm -f /run/${app}.ctr-id
|
||||||
'';
|
''}";
|
||||||
ExecStart = ''
|
ExecStart = ''
|
||||||
${pkgs.podman}/bin/podman run \
|
${pkgs.podman}/bin/podman run \
|
||||||
--rm \
|
--rm \
|
||||||
|
@ -66,13 +67,13 @@ in
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall = mkIf cfg.openFirewall {
|
networking.firewall = mkIf cfg.openFirewall {
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
32400 # Primary Plex port
|
32400 # Primary Plex port
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
# TODO add nginx proxy
|
# TODO add nginx proxy
|
||||||
# services.nginx.virtualHosts."${app}.${config.networking.domain}" = {
|
# services.nginx.virtualHosts."${app}.${config.networking.domain}" = {
|
||||||
|
|
Loading…
Reference in a new issue