3
0
Fork 0
forked from mirrors/nixpkgs

nixos/grafana: add socket configuration option

This commit is contained in:
Leo Maroni 2021-03-29 15:59:24 +02:00
parent 5bf0e509b5
commit c162597465
No known key found for this signature in database
GPG key ID: B1ADA545CD2CBACD

View file

@ -15,6 +15,7 @@ let
SERVER_PROTOCOL = cfg.protocol; SERVER_PROTOCOL = cfg.protocol;
SERVER_HTTP_ADDR = cfg.addr; SERVER_HTTP_ADDR = cfg.addr;
SERVER_HTTP_PORT = cfg.port; SERVER_HTTP_PORT = cfg.port;
SERVER_SOCKET = cfg.socket;
SERVER_DOMAIN = cfg.domain; SERVER_DOMAIN = cfg.domain;
SERVER_ROOT_URL = cfg.rootUrl; SERVER_ROOT_URL = cfg.rootUrl;
SERVER_STATIC_ROOT_PATH = cfg.staticRootPath; SERVER_STATIC_ROOT_PATH = cfg.staticRootPath;
@ -291,6 +292,12 @@ in {
type = types.int; type = types.int;
}; };
socket = mkOption {
description = "Listening socket.";
default = "/run/grafana/grafana.sock";
type = types.str;
};
domain = mkOption { domain = mkOption {
description = "The public facing domain name used to access grafana from a browser."; description = "The public facing domain name used to access grafana from a browser.";
default = "localhost"; default = "localhost";
@ -622,6 +629,8 @@ in {
serviceConfig = { serviceConfig = {
WorkingDirectory = cfg.dataDir; WorkingDirectory = cfg.dataDir;
User = "grafana"; User = "grafana";
RuntimeDirectory = "grafana";
RuntimeDirectoryMode = "0755";
}; };
preStart = '' preStart = ''
ln -fs ${cfg.package}/share/grafana/conf ${cfg.dataDir} ln -fs ${cfg.package}/share/grafana/conf ${cfg.dataDir}