nixos/klipper: add logFile option
This commit is contained in:
@@ -23,6 +23,16 @@ in
|
|||||||
description = lib.mdDoc "The Klipper package.";
|
description = lib.mdDoc "The Klipper package.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
logFile = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
example = "/var/lib/klipper/klipper.log";
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Path of the file Klipper should log to.
|
||||||
|
If `null`, it logs to stdout, which is not recommended by upstream.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
inputTTY = mkOption {
|
inputTTY = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "/run/klipper/tty";
|
default = "/run/klipper/tty";
|
||||||
@@ -151,7 +161,9 @@ in
|
|||||||
systemd.services.klipper =
|
systemd.services.klipper =
|
||||||
let
|
let
|
||||||
klippyArgs = "--input-tty=${cfg.inputTTY}"
|
klippyArgs = "--input-tty=${cfg.inputTTY}"
|
||||||
+ optionalString (cfg.apiSocket != null) " --api-server=${cfg.apiSocket}";
|
+ optionalString (cfg.apiSocket != null) " --api-server=${cfg.apiSocket}"
|
||||||
|
+ optionalString (cfg.logFile != null) " --logfile=${cfg.logFile}"
|
||||||
|
;
|
||||||
printerConfigPath =
|
printerConfigPath =
|
||||||
if cfg.mutableConfig
|
if cfg.mutableConfig
|
||||||
then cfg.mutableConfigFolder + "/printer.cfg"
|
then cfg.mutableConfigFolder + "/printer.cfg"
|
||||||
|
|||||||
Reference in New Issue
Block a user