Fava, change ledgers to list
This commit is contained in:
parent
1de1ba027b
commit
a2939e5613
1 changed files with 13 additions and 4 deletions
|
|
@ -3,9 +3,12 @@
|
|||
{
|
||||
options.fava = {
|
||||
enable = lib.mkEnableOption "Enables fava double entry accounting";
|
||||
ledgerFile = lib.mkOption { default = "/var/lib/fava/ledger.beancount"; };
|
||||
ledgerFiles = lib.mkOption {
|
||||
default = ["/var/lib/fava/ledger.beancount"];
|
||||
};
|
||||
port = lib.mkOption { default = "5000"; };
|
||||
host = lib.mkOption { default = "localhost"; };
|
||||
favaHome = lib.mkOption { default = "/var/lib/fava"; };
|
||||
};
|
||||
|
||||
config = lib.mkIf config.fava.enable {
|
||||
|
|
@ -15,7 +18,13 @@
|
|||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.fava}/bin/fava --port ${config.fava.port} --host ${config.fava.host} ${config.fava.ledgerFile}";
|
||||
ExecStart = with config.fava; let
|
||||
command = lib.concatStringsSep " " ([
|
||||
"${pkgs.fava}/bin/fava"
|
||||
"--port ${port}"
|
||||
"--host ${host}"
|
||||
] ++ ["--"] ++ ledgerFiles);
|
||||
in command;
|
||||
Type = "simple";
|
||||
User = "fava";
|
||||
Group = "fava";
|
||||
|
|
@ -26,12 +35,12 @@
|
|||
PrivateDevices = true;
|
||||
ProtectHome = true;
|
||||
ProtectSystem = "full";
|
||||
ReadWriteDirectories = "/var/lib/fava";
|
||||
ReadWriteDirectories = config.fava.favaHome;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.fava = {
|
||||
home = "/var/lib/fava";
|
||||
home = config.fava.favaHome;
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
group = "fava";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue