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