1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-08-02 05:57:46 +00:00

Add basic CLI logic and make log level specifiable

This commit is contained in:
RGBCube 2023-12-30 14:29:53 +03:00
parent ffbf1085af
commit 1010f21fe0
No known key found for this signature in database
5 changed files with 181 additions and 32 deletions

View file

@ -60,6 +60,15 @@
'';
};
logLevel = mkOption {
type = types.enum [ "off" "error" "warn" "info" "debug" "trace" ];
default = "info";
example = "warn";
description = mdDoc ''
Specifies the log level that the site service will log stuff with.
'';
};
openFirewall = mkOption {
type = types.bool;
default = false;
@ -81,7 +90,7 @@
capabilities = [ "" ] ++ optionals needsPrivileges [ "CAP_NET_BIND_SERVICE" ];
rootDirectory = "/run/site";
in {
ExecStart = "${self.packages.${pkgs.system}.site}/bin/site --port ${cfg.port}";
ExecStart = "${self.packages.${pkgs.system}.site}/bin/site --port ${cfg.port} --log-level ${cfg.logLevel}";
Restart = "always";
DynamicUser = true;
RootDirectory = rootDirectory;