nixos/etcd: allow to choose the package

Changed files
+4 -2
nixos
modules
services
misc
+4 -2
nixos/modules/services/misc/etcd.nix
···
type = types.bool;
};
+
package = mkPackageOptionMD pkgs "etcd" { };
+
name = mkOption {
description = lib.mdDoc "Etcd unique node name.";
default = config.networking.hostName;
···
serviceConfig = {
Type = "notify";
-
ExecStart = "${pkgs.etcd}/bin/etcd";
+
ExecStart = "${cfg.package}/bin/etcd";
User = "etcd";
LimitNOFILE = 40000;
};
};
-
environment.systemPackages = [ pkgs.etcd ];
+
environment.systemPackages = [ cfg.package ];
users.users.etcd = {
isSystemUser = true;