Merge pull request #204474 from peperunas/libreddit
libreddit: Add package option to module
This commit is contained in:
commit
d44e752fba
1 changed files with 8 additions and 1 deletions
|
@ -15,6 +15,13 @@ in
|
||||||
services.libreddit = {
|
services.libreddit = {
|
||||||
enable = mkEnableOption (lib.mdDoc "Private front-end for Reddit");
|
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 {
|
address = mkOption {
|
||||||
default = "0.0.0.0";
|
default = "0.0.0.0";
|
||||||
example = "127.0.0.1";
|
example = "127.0.0.1";
|
||||||
|
@ -45,7 +52,7 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
ExecStart = "${pkgs.libreddit}/bin/libreddit ${args}";
|
ExecStart = "${cfg.package}/bin/libreddit ${args}";
|
||||||
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "2s";
|
RestartSec = "2s";
|
||||||
|
|
Loading…
Reference in a new issue