Skip to content

Commit 0d3b29d

Browse files
Add logFile flag
1 parent 8361a16 commit 0d3b29d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nixos-modules/valheim.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,25 @@ in {
6666
default = true;
6767
description = lib.mdDoc ''
6868
Toggles visibility on the Steam server & community lists.
69+
6970
When not set, defaults to true (visible).
7071
Set to false to make the server private.
7172
'';
7273
};
7374

75+
logFile = lib.mkOption {
76+
type = with lib.types; nullOr str;
77+
default = null;
78+
example = "/var/log/valheim-server.log";
79+
description = lib.mdDoc ''
80+
The path where the server log file will be saved.
81+
82+
When set, this will redirect all logs from stdout to the specified path.
83+
This means that the logs will not be captured by systemd's journal.
84+
Leave this option unset to keep console logging enabled.
85+
'';
86+
};
87+
7488
password = lib.mkOption {
7589
type = lib.types.str;
7690
default = "";
@@ -236,6 +250,7 @@ in {
236250
"-public ${if cfg.public then "1" else "0"}"
237251
]
238252
++ (lib.lists.optional cfg.crossplay "-crossplay")
253+
++ (lib.lists.optional (cfg.logFile != null) "-logFile \"${cfg.logFile}\"")
239254
};
240255
};
241256
};

0 commit comments

Comments
 (0)