Fava, change port to number; open port

This commit is contained in:
Julia Lange 2025-09-16 17:35:34 -07:00
parent a2939e5613
commit 5c996e0885
Signed by: Julia
SSH key fingerprint: SHA256:50XUMcOFYPUs9/1j7p9SPnwASZ7QnxXm7THF7HkbqzQ
2 changed files with 5 additions and 3 deletions

View file

@ -67,7 +67,7 @@ in {
fava = { fava = {
enable = true; enable = true;
port = "5128"; port = 5128;
}; };
syncthing = { syncthing = {

View file

@ -6,7 +6,7 @@
ledgerFiles = lib.mkOption { ledgerFiles = lib.mkOption {
default = ["/var/lib/fava/ledger.beancount"]; default = ["/var/lib/fava/ledger.beancount"];
}; };
port = lib.mkOption { default = "5000"; }; port = lib.mkOption { default = 5000; };
host = lib.mkOption { default = "localhost"; }; host = lib.mkOption { default = "localhost"; };
favaHome = lib.mkOption { default = "/var/lib/fava"; }; favaHome = lib.mkOption { default = "/var/lib/fava"; };
}; };
@ -21,7 +21,7 @@
ExecStart = with config.fava; let ExecStart = with config.fava; let
command = lib.concatStringsSep " " ([ command = lib.concatStringsSep " " ([
"${pkgs.fava}/bin/fava" "${pkgs.fava}/bin/fava"
"--port ${port}" "--port ${builtins.toString port}"
"--host ${host}" "--host ${host}"
] ++ ["--"] ++ ledgerFiles); ] ++ ["--"] ++ ledgerFiles);
in command; in command;
@ -39,6 +39,8 @@
}; };
}; };
networking.firewall.allowedTCPPorts = [ config.fava.port ];
users.users.fava = { users.users.fava = {
home = config.fava.favaHome; home = config.fava.favaHome;
createHome = true; createHome = true;