@@ -15,6 +15,7 @@ let
1515 SERVER_PROTOCOL = cfg.protocol;
1616 SERVER_HTTP_ADDR = cfg.addr;
1717 SERVER_HTTP_PORT = cfg.port;
18+ SERVER_SOCKET = cfg.socket;
1819 SERVER_DOMAIN = cfg.domain;
1920 SERVER_ROOT_URL = cfg.rootUrl;
2021 SERVER_STATIC_ROOT_PATH = cfg.staticRootPath;
@@ -291,6 +292,12 @@ in {
291292 type = types.int;
292293 };
293294
295+ socket = mkOption {
296+ description = "Listening socket.";
297+ default = "/run/grafana/grafana.sock";
298+ type = types.str;
299+ };
300+
294301 domain = mkOption {
295302 description = "The public facing domain name used to access grafana from a browser.";
296303 default = "localhost";
@@ -622,6 +629,8 @@ in {
622629 serviceConfig = {
623630 WorkingDirectory = cfg.dataDir;
624631 User = "grafana";
632+ RuntimeDirectory = "grafana";
633+ RuntimeDirectoryMode = "0755";
625634 };
626635 preStart = ''
627636 ln -fs ${cfg.package}/share/grafana/conf ${cfg.dataDir}