Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate config files on build time #218

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

milahu
Copy link

@milahu milahu commented Apr 1, 2024

on build time, run this to write all config files to app/config/linux/

# enable the original install function in native-autoinstall.js
export VDHCOAPP_INSTALL_ON_BUILDTIME=1

echo generating config files for linux
export HOME=$PWD/app/config/linux
grep '^only_if_dir_exists = "~/\.' config.toml | cut -d'"' -f2 |
  while read d; do mkdir -p "$HOME/${d:2}"; done
./app/src/main.js install

on runtime, run vdhcoapp install
to create symlinks from $HOME to the installed app/config/linux/

example

$ readlink /home/user/.config/chromium/NativeMessagingHosts/net.downloadhelper.coapp.json
/nix/store/0nrvqzclq34a53nyk89h7b4i3dq9mdyr-vdhcoapp-2.0.19/opt/vdhcoapp/config/linux/.config/chromium/NativeMessagingHosts/net.downloadhelper.coapp.json

im using this in vdhcoapp.nix
where all paths are constant so the generated config files are always identical
and when running vdhcoapp install again on runtime
it is cheaper to compare symlinks
instead of generating the config files and comparing file contents

where all paths are constant

this will be true only for some users
so probably this will not be merged into the main branch

based on #217

@milahu milahu force-pushed the generate-config-files-on-build-time branch from 4d65a33 to 548f6ec Compare April 1, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant