nixos/nitter: add package option
This commit is contained in:
parent
97b97c102e
commit
be636c6c96
@ -49,6 +49,13 @@ in
|
|||||||
services.nitter = {
|
services.nitter = {
|
||||||
enable = mkEnableOption "If enabled, start Nitter.";
|
enable = mkEnableOption "If enabled, start Nitter.";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.nitter;
|
||||||
|
type = types.package;
|
||||||
|
defaultText = literalExpression "pkgs.nitter";
|
||||||
|
description = "The nitter derivation to use.";
|
||||||
|
};
|
||||||
|
|
||||||
server = {
|
server = {
|
||||||
address = mkOption {
|
address = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
@ -78,8 +85,8 @@ in
|
|||||||
|
|
||||||
staticDir = mkOption {
|
staticDir = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "${pkgs.nitter}/share/nitter/public";
|
default = "${cfg.package}/share/nitter/public";
|
||||||
defaultText = literalExpression ''"''${pkgs.nitter}/share/nitter/public"'';
|
defaultText = literalExpression ''"''${config.services.nitter.package}/share/nitter/public"'';
|
||||||
description = "Path to the static files directory.";
|
description = "Path to the static files directory.";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -306,8 +313,8 @@ in
|
|||||||
Environment = [ "NITTER_CONF_FILE=/var/lib/nitter/nitter.conf" ];
|
Environment = [ "NITTER_CONF_FILE=/var/lib/nitter/nitter.conf" ];
|
||||||
# Some parts of Nitter expect `public` folder in working directory,
|
# Some parts of Nitter expect `public` folder in working directory,
|
||||||
# see https://github.com/zedeus/nitter/issues/414
|
# see https://github.com/zedeus/nitter/issues/414
|
||||||
WorkingDirectory = "${pkgs.nitter}/share/nitter";
|
WorkingDirectory = "${cfg.package}/share/nitter";
|
||||||
ExecStart = "${pkgs.nitter}/bin/nitter";
|
ExecStart = "${cfg.package}/bin/nitter";
|
||||||
ExecStartPre = "${preStart}";
|
ExecStartPre = "${preStart}";
|
||||||
AmbientCapabilities = lib.mkIf (cfg.server.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
AmbientCapabilities = lib.mkIf (cfg.server.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
Loading…
Reference in New Issue
Block a user