lol

misc.etcd: get closer to upstream service definition

taken from
https://github.com/coreos/etcd/blob/master/contrib/systemd/etcd.service

I intentionally kept "After = network.target" because I think it's
missing upstream (https://github.com/coreos/etcd/pull/6388)

+8 -2
+8 -2
nixos/modules/services/misc/etcd.nix
··· 143 143 144 144 config = mkIf cfg.enable { 145 145 systemd.services.etcd = { 146 - description = "Etcd Daemon"; 146 + description = "etcd key-value store"; 147 147 wantedBy = [ "multi-user.target" ]; 148 - after = [ "network-interfaces.target" ]; 148 + after = [ "network.target" ]; 149 149 150 150 environment = (filterAttrs (n: v: v != null) { 151 151 ETCD_NAME = cfg.name; ··· 168 168 ETCD_INITIAL_CLUSTER_TOKEN = cfg.initialClusterToken; 169 169 }) // (mapAttrs' (n: v: nameValuePair "ETCD_${n}" v) cfg.extraConf); 170 170 171 + unitConfig = { 172 + Documentation = "https://github.com/coreos/etcd"; 173 + }; 174 + 171 175 serviceConfig = { 172 176 Type = "notify"; 173 177 ExecStart = "${pkgs.etcd.bin}/bin/etcd"; 174 178 User = "etcd"; 175 179 PermissionsStartOnly = true; 180 + LimitNOFILE = 40000; 176 181 }; 182 + 177 183 preStart = '' 178 184 mkdir -m 0700 -p ${cfg.dataDir} 179 185 if [ "$(id -u)" = 0 ]; then chown etcd ${cfg.dataDir}; fi