summary refs log tree commit diff
path: root/nixos/modules/services/networking/consul.nix
diff options
context:
space:
mode:
authorIndeedNotJames <git@indeednotjames.com>2023-04-12 03:50:48 +0200
committerIndeedNotJames <git@indeednotjames.com>2023-04-21 03:46:54 +0200
commit6ad64af778b6f44a0e8a7ca0e74f21d3c4089054 (patch)
tree7649f93378c584a643e8e7275c96b106436ba8c8 /nixos/modules/services/networking/consul.nix
parent9c1f292155efcefc147186d76921874a16caee01 (diff)
downloadnixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.tar
nixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.tar.gz
nixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.tar.bz2
nixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.tar.lz
nixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.tar.xz
nixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.tar.zst
nixpkgs-6ad64af778b6f44a0e8a7ca0e74f21d3c4089054.zip
nixos/consul: use `lib.getExe` where possible
which allows the use of custom packages, that may not have binaries called `consul` or `consul-alerts` in their `/bin/*` (though arguably pretty unlikely to be ever used)
Diffstat (limited to 'nixos/modules/services/networking/consul.nix')
-rw-r--r--nixos/modules/services/networking/consul.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/consul.nix b/nixos/modules/services/networking/consul.nix
index 4a9d0f4c3d1..955463b9031 100644
--- a/nixos/modules/services/networking/consul.nix
+++ b/nixos/modules/services/networking/consul.nix
@@ -199,7 +199,7 @@ in
             (filterAttrs (n: _: hasPrefix "consul.d/" n) config.environment.etc);
 
         serviceConfig = {
-          ExecStart = "@${cfg.package}/bin/consul consul agent -config-dir /etc/consul.d"
+          ExecStart = "@${lib.getExe cfg.package} consul agent -config-dir /etc/consul.d"
             + concatMapStrings (n: " -config-file ${n}") configFiles;
           ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
           PermissionsStartOnly = true;
@@ -207,7 +207,7 @@ in
           Restart = "on-failure";
           TimeoutStartSec = "infinity";
         } // (optionalAttrs (cfg.leaveOnStop) {
-          ExecStop = "${cfg.package}/bin/consul leave";
+          ExecStop = "${lib.getExe cfg.package} leave";
         });
 
         path = with pkgs; [ iproute2 gawk cfg.package ];
@@ -269,7 +269,7 @@ in
 
         serviceConfig = {
           ExecStart = ''
-            ${cfg.alerts.package}/bin/consul-alerts start \
+            ${lib.getExe cfg.alerts.package} start \
               --alert-addr=${cfg.alerts.listenAddr} \
               --consul-addr=${cfg.alerts.consulAddr} \
               ${optionalString cfg.alerts.watchChecks "--watch-checks"} \