nixos/pykms: fix launcher

This commit is contained in:
Peter Hoeg 2021-01-31 20:40:45 +08:00
parent a3773da142
commit c9091a9def

View File

@ -1,12 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.pykms;
libDir = "/var/lib/pykms";
in {
in
{
meta.maintainers = with lib.maintainers; [ peterhoeg ];
imports = [
@ -46,14 +46,14 @@ in {
};
logLevel = mkOption {
type = types.enum [ "CRITICAL" "ERROR" "WARNING" "INFO" "DEBUG" "MINI" ];
type = types.enum [ "CRITICAL" "ERROR" "WARNING" "INFO" "DEBUG" "MININFO" ];
default = "INFO";
description = "How much to log";
};
extraArgs = mkOption {
type = types.listOf types.str;
default = [];
default = [ ];
description = "Additional arguments";
};
};
@ -74,8 +74,9 @@ in {
ExecStartPre = "${getBin pykms}/libexec/create_pykms_db.sh ${libDir}/clients.db";
ExecStart = lib.concatStringsSep " " ([
"${getBin pykms}/bin/server"
"--logfile STDOUT"
"--loglevel ${cfg.logLevel}"
"--logfile=STDOUT"
"--loglevel=${cfg.logLevel}"
"--sqlite=${libDir}/clients.db"
] ++ cfg.extraArgs ++ [
cfg.listenAddress
(toString cfg.port)