Fix EnvironmentFile merge with mkMerge
This commit is contained in:
parent
2dd8ef2797
commit
d7c3bd0775
1 changed files with 30 additions and 27 deletions
|
|
@ -75,7 +75,8 @@ in
|
|||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
serviceConfig = lib.mkMerge [
|
||||
{
|
||||
Type = "simple";
|
||||
User = "openclaw";
|
||||
Group = "openclaw";
|
||||
|
|
@ -89,8 +90,6 @@ in
|
|||
"PATH=${pkgs.nodejs_22}/bin:${pkgs.git}/bin:${pkgs.bash}/bin:${pkgs.coreutils}/bin"
|
||||
];
|
||||
|
||||
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
|
||||
|
||||
ExecStartPre = [
|
||||
"${pkgs.coreutils}/bin/mkdir -p ${configDir} ${dataDir} ${workspaceDir}"
|
||||
"${pkgs.bash}/bin/bash -c 'cp -n /etc/openclaw/openclaw.json ${configDir}/ || true'"
|
||||
|
|
@ -106,7 +105,11 @@ in
|
|||
ProtectSystem = "strict";
|
||||
ReadWritePaths = [ "/var/lib/openclaw" configDir dataDir workspaceDir ];
|
||||
NoNewPrivileges = true;
|
||||
};
|
||||
}
|
||||
(lib.mkIf (cfg.environmentFile != null) {
|
||||
EnvironmentFile = cfg.environmentFile;
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue