Your one-stop-cake-shop for everything Freshly Baked has to offer

feat(pm/fava): allow adding extra files #186

deleted opened by a.starrysky.fyi targeting main from private/minion/push-xpqrvpwlrtsk

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...

Labels

None yet.

requested-reviewers

None yet.

approved

None yet.

tested-working

None yet.

rejected

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:uuyqs6y3pwtbteet4swt5i5y/sh.tangled.repo.pull/3mdi2nvgvjg22
+24 -5
Diff #1
+24 -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 "\n" ( 127 + map (file: ''include "${file}"'') ( 128 + [ 129 + userConfig.favaOptions.default-file 130 + ] 131 + ++ (userConfig.extraFiles or [ ]) 132 + ) 133 + )} 126 134 '' 127 135 ) 128 136 )) ··· 161 169 162 170 preStart = 163 171 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 - ''; 172 + userConfigToCreationScript = 173 + userConfig: 174 + builtins.concatStringsSep "\n" ( 175 + map 176 + (file: '' 177 + ${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "${file}")" 178 + ${pkgs.coreutils}/bin/touch -a ${file} 179 + '') 180 + ( 181 + [ 182 + userConfig.favaOptions.default-file 183 + ] 184 + ++ (userConfig.extraFiles or [ ]) 185 + ) 186 + ); 168 187 in 169 188 lib.trivial.pipe userConfigs [ 170 189 (map userConfigToCreationScript)

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
feat(pm/fava): allow adding extra files
expand 0 comments
This pull has been deleted (possibly by jj abandon or jj squash)
1 commit
expand
feat(pm/fava): allow adding extra files
expand 0 comments