mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-23 13:24:29 +00:00
Merge pull request #204474 from peperunas/libreddit
libreddit: Add package option to module
This commit is contained in:
commit
d44e752fba
@ -15,6 +15,13 @@ in
|
||||
services.libreddit = {
|
||||
enable = mkEnableOption (lib.mdDoc "Private front-end for Reddit");
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.libreddit;
|
||||
defaultText = literalExpression "pkgs.libreddit";
|
||||
description = lib.mdDoc "Libreddit package to use.";
|
||||
};
|
||||
|
||||
address = mkOption {
|
||||
default = "0.0.0.0";
|
||||
example = "127.0.0.1";
|
||||
@ -45,7 +52,7 @@ in
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
ExecStart = "${pkgs.libreddit}/bin/libreddit ${args}";
|
||||
ExecStart = "${cfg.package}/bin/libreddit ${args}";
|
||||
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
||||
Restart = "on-failure";
|
||||
RestartSec = "2s";
|
||||
|
Loading…
Reference in New Issue
Block a user