Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

generate config files on build time#218

Open
milahu wants to merge 3 commits intoaclap-dev:masterfrom
milahu:generate-config-files-on-build-time
Open

generate config files on build time#218
milahu wants to merge 3 commits intoaclap-dev:masterfrom
milahu:generate-config-files-on-build-time

Conversation

@milahu
Copy link
Copy Markdown

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant