I've got some old fava stuff but I want to work in a new file. We can allow this by importing the new file from our config in the same way as our default file...
+13
-5
Diff
round #0
+13
-5
packetmix/systems/teal/fava.nix
+13
-5
packetmix/systems/teal/fava.nix
···
35
35
import-config = builtins.toString ./fava/minion/truelayer.py;
36
36
import-dirs = "/var/lib/private/fava/minion/";
37
37
};
38
+
extraFiles = [ "/var/lib/private/fava/minion-archive-2024.beancount" ];
38
39
extraConfig = ''
39
40
plugin "fava.plugins.tag_discovered_documents"
40
41
plugin "fava.plugins.link_documents"
···
122
123
${beancountOptions}
123
124
${userConfig.extraConfig or ""}
124
125
125
-
include "${userConfig.favaOptions.default-file}"
126
+
${builtins.concatStringsSep
127
+
"\n"
128
+
(map (file: ''include "${file}"'')
129
+
([
130
+
userConfig.favaOptions.default-file
131
+
] ++ (userConfig.extraFiles or [])))}
126
132
''
127
133
)
128
134
))
···
161
167
162
168
preStart =
163
169
let
164
-
userConfigToCreationScript = userConfig: ''
165
-
${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "${userConfig.favaOptions.default-file}")"
166
-
${pkgs.coreutils}/bin/touch -a ${userConfig.favaOptions.default-file}
167
-
'';
170
+
userConfigToCreationScript = userConfig: builtins.concatStringsSep "\n" (map (file: ''
171
+
${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "${file}")"
172
+
${pkgs.coreutils}/bin/touch -a ${file}
173
+
'') ([
174
+
userConfig.favaOptions.default-file
175
+
] ++ (userConfig.extraFiles or [])));
168
176
in
169
177
lib.trivial.pipe userConfigs [
170
178
(map userConfigToCreationScript)
History
2 rounds
0 comments
a.starrysky.fyi
submitted
#1
1 commit
expand
collapse
feat(pm/fava): allow adding extra files
I've got some old fava stuff but I want to work in a new file. We can
allow this by importing the new file from our config in the same way as
our default file...
expand 0 comments
This pull has been deleted (possibly by jj abandon or jj squash)
a.starrysky.fyi
submitted
#0
1 commit
expand
collapse
feat(pm/fava): allow adding extra files
I've got some old fava stuff but I want to work in a new file. We can
allow this by importing the new file from our config in the same way as
our default file...