From 90e5e88c74f88dcf9cebf8d36924f64fe60d0cbc Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 31 Mar 2024 14:03:38 +0200 Subject: [PATCH] nixos/libreddit: Don't hard code binary name in `ExecStart` Hard coding the name to `libreddit` makes it impossible to use this module to run `redlib` (a continued fork of `libreddit`). As `libreddit` has the `mainProgram` meta attribute set, changing this to `lib.getExe` should not change the module for `libreddit`, but allows it to work with the `redlib` package. --- nixos/modules/services/misc/libreddit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/libreddit.nix b/nixos/modules/services/misc/libreddit.nix index 02d71c198e78..e125d975d7e2 100644 --- a/nixos/modules/services/misc/libreddit.nix +++ b/nixos/modules/services/misc/libreddit.nix @@ -47,7 +47,7 @@ in after = [ "network.target" ]; serviceConfig = { DynamicUser = true; - ExecStart = "${cfg.package}/bin/libreddit ${args}"; + ExecStart = "${lib.getExe cfg.package} ${args}"; AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ]; Restart = "on-failure"; RestartSec = "2s";