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 = {
|
options.fava = {
|
||||||
enable = lib.mkEnableOption "Enables fava double entry accounting";
|
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"; };
|
port = lib.mkOption { default = "5000"; };
|
||||||
host = lib.mkOption { default = "localhost"; };
|
host = lib.mkOption { default = "localhost"; };
|
||||||
|
favaHome = lib.mkOption { default = "/var/lib/fava"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.fava.enable {
|
config = lib.mkIf config.fava.enable {
|
||||||
|
|
@ -15,7 +18,13 @@
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
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";
|
Type = "simple";
|
||||||
User = "fava";
|
User = "fava";
|
||||||
Group = "fava";
|
Group = "fava";
|
||||||
|
|
@ -26,12 +35,12 @@
|
||||||
PrivateDevices = true;
|
PrivateDevices = true;
|
||||||
ProtectHome = true;
|
ProtectHome = true;
|
||||||
ProtectSystem = "full";
|
ProtectSystem = "full";
|
||||||
ReadWriteDirectories = "/var/lib/fava";
|
ReadWriteDirectories = config.fava.favaHome;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.fava = {
|
users.users.fava = {
|
||||||
home = "/var/lib/fava";
|
home = config.fava.favaHome;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = "fava";
|
group = "fava";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue