From 12b2ee2901e952dbf9663da478bdcd25ef5f638f Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 20 Nov 2023 22:07:19 +0100 Subject: [PATCH] nix(systemd): use var --- nix/systemd.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nix/systemd.nix b/nix/systemd.nix index def1298..60e1a58 100644 --- a/nix/systemd.nix +++ b/nix/systemd.nix @@ -187,7 +187,9 @@ in { }; }; - nextcloud = { + nextcloud = let + composeF = "%h/.nextcloud/docker-compose.yml"; + in { Unit = { Description = "Podman container Nextcloud"; PartOf = swayTgt; @@ -204,9 +206,9 @@ in { RestartSec = 5; TimeoutStartSec = 600; # TimeoutStopSec=10; - ExecStartPre = "/usr/bin/podman-compose -f %h/.nextcloud/docker-compose.yml -p nextcloud down"; - ExecStart = "/usr/bin/podman-compose -f %h/.nextcloud/docker-compose.yml -p nextcloud up --remove-orphans"; - ExecStop = "/usr/bin/podman-compose -f %h/.nextcloud/docker-compose.yml -p nextcloud down"; + ExecStartPre = "/usr/bin/podman-compose -f ${composeF} -p nextcloud down"; + ExecStart = "/usr/bin/podman-compose -f ${composeF} -p nextcloud up --remove-orphans"; + ExecStop = "/usr/bin/podman-compose -f ${composeF} -p nextcloud down"; Type = "simple"; Delegate = "no"; ProtectSystem = "strict";