diff --git a/hosts/juri/host.nix b/hosts/juri/host.nix index 9ca4456..57c9a47 100644 --- a/hosts/juri/host.nix +++ b/hosts/juri/host.nix @@ -67,7 +67,7 @@ in { fava = { enable = true; - port = "5128"; + port = 5128; }; syncthing = { diff --git a/nixosModules/services/fava/service.nix b/nixosModules/services/fava/service.nix index f43930f..b8bee8f 100644 --- a/nixosModules/services/fava/service.nix +++ b/nixosModules/services/fava/service.nix @@ -6,7 +6,7 @@ ledgerFiles = lib.mkOption { default = ["/var/lib/fava/ledger.beancount"]; }; - port = lib.mkOption { default = "5000"; }; + port = lib.mkOption { default = 5000; }; host = lib.mkOption { default = "localhost"; }; favaHome = lib.mkOption { default = "/var/lib/fava"; }; }; @@ -21,7 +21,7 @@ ExecStart = with config.fava; let command = lib.concatStringsSep " " ([ "${pkgs.fava}/bin/fava" - "--port ${port}" + "--port ${builtins.toString port}" "--host ${host}" ] ++ ["--"] ++ ledgerFiles); in command; @@ -39,6 +39,8 @@ }; }; + networking.firewall.allowedTCPPorts = [ config.fava.port ]; + users.users.fava = { home = config.fava.favaHome; createHome = true;