git.iko.soy/typeable/nixpkgs
on master help sign in
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)

commit5481831263b6dde4a33d8fa6f20dff38646a1949 authorAlexander Ried <ried@mytum.de> dateMon 12 Sep 2016, 16:34 (10 years ago) parent23ca90b
1 file changed+8−2
nixos/modules/services/misc/etcd.nix+8−2
nixos/modules/services/misc/etcd.nix+8−2
@@ -143,9 +143,9 @@ in {
143143
144144 config = mkIf cfg.enable {
145145 systemd.services.etcd = {
146− description = "Etcd Daemon";
146+ description = "etcd key-value store";
147147 wantedBy = [ "multi-user.target" ];
148− after = [ "network-interfaces.target" ];
148+ after = [ "network.target" ];
149149
150150 environment = (filterAttrs (n: v: v != null) {
151151 ETCD_NAME = cfg.name;
@@ -168,12 +168,18 @@ in {
168168 ETCD_INITIAL_CLUSTER_TOKEN = cfg.initialClusterToken;
169169 }) // (mapAttrs' (n: v: nameValuePair "ETCD_${n}" v) cfg.extraConf);
170170
171+ unitConfig = {
172+ Documentation = "https://github.com/coreos/etcd";
173+ };
174+
171175 serviceConfig = {
172176 Type = "notify";
173177 ExecStart = "${pkgs.etcd.bin}/bin/etcd";
174178 User = "etcd";
175179 PermissionsStartOnly = true;
180+ LimitNOFILE = 40000;
176181 };
182+
177183 preStart = ''
178184 mkdir -m 0700 -p ${cfg.dataDir}
179185 if [ "$(id -u)" = 0 ]; then chown etcd ${cfg.dataDir}; fi