File tree Expand file tree Collapse file tree
parts/features/apps/wealthfolio Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{ ...} : {
22 flake . modules . homeManager . wealthfolio = {
3- lib ,
4- osConfig ,
53 pkgs ,
64 ...
75 } : let
4240 | sponge apps/tauri/tauri.conf.json
4341 '' ;
4442 } ) ;
45- in {
46- home . persistence . "/persist" = lib . mkIf osConfig . dendrix . isImpermanent {
47- directories = [
48- ".local/share/com.teymz.wealthfolio"
49- ".local/share/Wealthfolio"
50- ".config/com.teymz.wealthfolio"
51- ] ;
43+
44+ wealthfolio-wrapper = pkgs . writeShellApplication {
45+ name = "wealthfolio-wrapper" ;
46+ runtimeInputs = [ wealthfolio pkgs . gocryptfs pkgs . zenity pkgs . util-linux pkgs . coreutils pkgs . procps ] ;
47+ text = builtins . readFile ./wealthfolio-wrapper.sh ;
5248 } ;
49+ in {
50+ home . packages = [ wealthfolio wealthfolio-wrapper ] ;
5351
54- home . packages = [ wealthfolio ] ;
52+ xdg . desktopEntries . Wealthfolio = {
53+ name = "Wealthfolio" ;
54+ exec = "wealthfolio-wrapper" ;
55+ terminal = false ;
56+ type = "Application" ;
57+ categories = [ "Office" "Finance" ] ;
58+ icon = "com.teymz.wealthfolio" ;
59+ } ;
5560 } ;
5661}
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Wrapper that mounts a gocryptfs vault before launching Wealthfolio
3+ # and unmounts it on exit. Provides encryption-at-rest for financial data.
4+ #
5+ # Mounts the vault directly at the XDG data path so Wealthfolio
6+ # reads/writes through the FUSE mount transparently.
7+
8+ VAULT_DIR=" $HOME /.wealthfolio-vault"
9+ MOUNT_DIR=" $HOME /.local/share/com.teymz.wealthfolio"
10+
11+ cleanup () {
12+ if mountpoint -q " $MOUNT_DIR " ; then
13+ /run/wrappers/bin/fusermount -u " $MOUNT_DIR "
14+ fi
15+ # Remove plaintext leftovers from the underlying directory
16+ rm -rf " ${MOUNT_DIR:? } " /*
17+ }
18+
19+ trap cleanup EXIT INT TERM
20+
21+ if mountpoint -q " $MOUNT_DIR " ; then
22+ if pgrep -x Wealthfolio > /dev/null; then
23+ exec Wealthfolio
24+ fi
25+ # Stale mount from a crashed session — clean it up
26+ /run/wrappers/bin/fusermount -u " $MOUNT_DIR "
27+ fi
28+
29+ password=$( zenity --password --title=" Wealthfolio Vault" ) || exit 0
30+
31+ mkdir -p " $VAULT_DIR " " $MOUNT_DIR "
32+
33+ # First-run: initialize the vault
34+ if [ ! -f " $VAULT_DIR /gocryptfs.conf" ]; then
35+ echo " $password " | gocryptfs -init -q " $VAULT_DIR "
36+ fi
37+
38+ echo " $password " | gocryptfs -q -nonempty " $VAULT_DIR " " $MOUNT_DIR "
39+ unset password
40+
41+ Wealthfolio &
42+ WEALTHFOLIO_PID=$!
43+ wait " $WEALTHFOLIO_PID " || true
44+
45+ # Also wait for any forked children
46+ while pgrep -x Wealthfolio > /dev/null; do
47+ sleep 1
48+ done
You can’t perform that action at this time.
0 commit comments