Nim bundle static config file

nim is not a particularly popular language but this question goes to the larger philosophical understanding of the ClearLinux design.

The nim language tools have a file nim.cfg. This file can be included in any and maybe all folders of a project. There are also some “global” folders that make sense too. For example nim is packaged with a global num.cfg that would normally be placed in /etc. Since /etc is considered generally off limits the num.cfg file might go in the users home/config. But then maybe there is a pseudo /etc folder some place where this file would make sense.

At this point I hope I have not lost anyone… The point is where should 3rd parties expect to put global artifacts?

thanks

If it’s global, then /etc. How do other distros handle this?

I just watched the ClearLinux into video so /etc is not the place for it since it is installed as part of a bundle. It needs to be placed in …/default/etc. hmmm… how to do that?

Bunldes install files under /usr, including default config files. There’s no /use/etc.

If by convention the config file for FOO is at /etc/foo.conf or /etc/foo.conf.d/* then usually it’s installed at /usr/foo/* or /usr/defaults/foo/*

Usually packages are patched so that they still read config files from /etc, but if there’s no such file, they may read the default config from /usr, if there’s one.

I haven’t had the time to dig into nim.cfg. Ideally nim reads several config files and picks the best one, but one would have to read the code to find out if it actually does. e.g. if there is no /etc/nim.cfg then perhaps nim should fallback to /usr/share/defaults/etc/nim.cfg. That file we could ship as part of the packaging.

@ahkok you have it exactly right. A possible first step, however, might be to include the file into the defaults/etc… and then add a note to the bundle for devs to add defailt/etc to their compiler path.

I’m pushing a patch to nim that will fall back to /usr/share/defaults/nim/nim.cfg if no config file is under /etc. I hope that works - this should be in a release in 1-2 days or so. Please test and report any further issues with it.

1 Like