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:
parent
ffbf1085af
commit
1010f21fe0
5 changed files with 181 additions and 32 deletions
11
flake.nix
11
flake.nix
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue