diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2022-12-11 01:23:22 +0100 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2022-12-11 01:23:22 +0100 |
commit | fda65523fbb8dd7ef4a2eba4d39f88ce19245713 (patch) | |
tree | 0215d70d48ea11ef447d234bb9e1953def79de48 /nixos | |
parent | f226b4cb66e33b9d408d9b31978448f2706795af (diff) | |
download | nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.tar nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.tar.gz nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.tar.bz2 nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.tar.lz nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.tar.xz nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.tar.zst nixlib-fda65523fbb8dd7ef4a2eba4d39f88ce19245713.zip |
nixos/evcc: Fix unit environment
In some recent version evcc started requiring `getent` in the PATH, or else it would fail to start. It also now requires an sqlite database, which it tries to create a directory for at `$HOME/.evcc`, so we now need to provide a StateDirectory.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/home-automation/evcc.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/services/home-automation/evcc.nix b/nixos/modules/services/home-automation/evcc.nix index c12ba9d0c1e2..efa2cf244313 100644 --- a/nixos/modules/services/home-automation/evcc.nix +++ b/nixos/modules/services/home-automation/evcc.nix @@ -48,7 +48,10 @@ in wantedBy = [ "multi-user.target" ]; - + environment.HOME = "/var/lib/evcc"; + path = with pkgs; [ + glibc # requires getent + ]; serviceConfig = { ExecStart = "${package}/bin/evcc --config ${configFile} ${escapeShellArgs cfg.extraArgs}"; CapabilityBoundingSet = [ "" ]; @@ -77,6 +80,7 @@ in ProtectKernelModules = true; ProtectKernelTunables = true; ProtectProc = "invisible"; + StateDirectory = "evcc"; SystemCallArchitectures = "native"; SystemCallFilter = [ "@system-service" |