nix: use vars some more

This commit is contained in:
surtur 2023-11-21 22:14:04 +01:00
parent d125d70562
commit c90bd1553e
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
4 changed files with 6 additions and 8 deletions

@ -1,5 +1,4 @@
{config, ...}: {config, ...}: let
let
svc = "coredns.service"; svc = "coredns.service";
usr = "${toString config.users.users.coredns.name}"; usr = "${toString config.users.users.coredns.name}";
in { in {

@ -1,5 +1,4 @@
{config, ...}: {config, ...}: let
let
svc = "coredns.service"; svc = "coredns.service";
usr = "${toString config.users.users.coredns.name}"; usr = "${toString config.users.users.coredns.name}";
in { in {

@ -235,7 +235,7 @@ in {
ProtectSystem = "strict"; ProtectSystem = "strict";
LimitNOFILE = 1048576; LimitNOFILE = 1048576;
LimitNPROC = 512; LimitNPROC = 512;
User = "coredns"; User = usr;
EnvironmentFile = config.sops.templates.corednsEnv.path; EnvironmentFile = config.sops.templates.corednsEnv.path;
# LoadCredential = lib.mapAttrsToList (name: path: "${name}:${path}") cfg.credentials; # LoadCredential = lib.mapAttrsToList (name: path: "${name}:${path}") cfg.credentials;
DeviceAllow = ""; DeviceAllow = "";
@ -275,8 +275,8 @@ in {
}; };
users.users.coredns = { users.users.coredns = {
group = "coredns"; group = usr;
home = "/etc/coredns"; home = "/etc/" + usr;
createHome = false; createHome = false;
isSystemUser = true; isSystemUser = true;
extraGroups = ["users"]; extraGroups = ["users"];

@ -124,7 +124,7 @@ in {
}; };
systemd.services.dnscrypt-proxy2.serviceConfig = { systemd.services.dnscrypt-proxy2.serviceConfig = {
StateDirectory = "dnscrypt-proxy"; StateDirectory = usr;
WorkingDirectory = "/"; WorkingDirectory = "/";
# StartLimitIntervalSec = 5; # StartLimitIntervalSec = 5;
StartLimitBurst = 10; StartLimitBurst = 10;