Skip to content

Instantly share code, notes, and snippets.

@benpye

benpye/test.nix Secret

Created February 24, 2019 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benpye/f43ed72447bb59ca34a66a1265a1655e to your computer and use it in GitHub Desktop.
Save benpye/f43ed72447bb59ca34a66a1265a1655e to your computer and use it in GitHub Desktop.
systemd.services.coredns = {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart =
let configFile = pkgs.writeText "Corefile"
'' //STUFF
'';
in
"${pkgs.coredns}/bin/coredns -conf=${configFile}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Type = "simple";
User = "coredns";
Group = "coredns";
Restart = "on-failure";
StartLimitInterval = 86400;
StartLimitBurst = 5;
AmbientCapabilities = "cap_net_bind_service";
CapabilityBoundingSet = "cap_net_bind_service";
NoNewPrivileges = true;
LimitNPROC = 64;
LimitNOFILE = 1048576;
PrivateTmp = true;
PrivateDevices = true;
ProtectHome = true;
ProtectSystem = "strict";
ReadWriteDirectories = cfg.dataDir;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment