guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are declarative app configs worth it?


From: Murad Mamedov
Subject: Re: Are declarative app configs worth it?
Date: Wed, 27 Dec 2023 07:15:48 +0300
User-agent: mu4e 1.10.8; emacs 30.0.50


Hi,

I was adding to guix fail2ban, greetd services with their configurations and pending configuration for connman. Basically the overall idea behind guix (i.e. having declarative configuration) is really nice. Having such mechanism powered by general purpose language like scheme is another very nice. In the ideal world, where all configurations are provided and ported to guix with included documentation whould be beautiful from user
perspective.

However, we are not in an ideal world. From what I see, these problems
araise from three main sources:

- Programs they selves. For instance if every program would follow let's say something like 12-factor app, then such programs would have very clear purpose, and thus clear configuration. One of such good examples in my practice would be greetd. Worst example would be fail2ban, where half of program logic is expressed in the configuration, very ugly very bad. Users have hard time to understand how it is configured in plain, porting such mechanism to another dsl, whole another level of pain. Rarely programs demand complex configuration, as some one noted, there is already a conventional mechanism to add `extra-config`
 field or having `plain-config-file-like` option saves the day.

- Porters of programs and services to guix. Such person should not
blindly port the configuration to the guix, but clearly understand how close or far away program from let's say 12-factor app (if we
 take it as reference). If very close, providing detailed strict
 configuration records is a bliss. If very far, porter have to
think and add `extra-config` and `plain-config-file-like` options.

- Users of guix have to understand, that what they write in scheme
 for guix is not a configuration but a program. Once you trully
 understand that, as a user you may change your behavior to have
 configurations stored in the variables instead of inlining them
 within service configuration. Then they can be used in service,
or manualy serialized to a file. Or even, one might write a program
 to traverse services and/or operating-system and to serialize
configuration on disk for LFS-like or systemd-like compatibility.

IMHO, separating configuration (applications) from configuration (guix
applications?) is not very wise way and will defeat very idea of
having single, programming language based declarative configuration.

What we need is more tooling around configuration and documentation,
for instance:
- tool to extract documentation from man pages
- tool to "copy-paste" configuration documentation into guix.texi
- tool to cross link packages, configuration documentations
- code completion with documentation hinting in writing guix scheme
- etc.

Thanks in advance,
muradm

Sergey Trofimov <sarg@sarg.org.ru> writes:

Hi guix,

I want to start a discussion around how to manage user app config
files.
Copying my message from https://issues.guix.gnu.org/68010, where
home-zathura-configuration with 76 fields is proposed.

I have mixed feelings about pulling 3rd-party software configurations
in guix:
- adding it to guix increases maintenance burden: new versions could
 add or remove config options
- it requires documentation/translation, another hidden cost
- it bloats guix: imagine if we add configs for every
  user-configurable app
- such configs are not easily transferrable: if I were to use the
  same app in non-guix env, I'd have to maintain 2 configs

Another recent example is `oci-container-configuration` which defines a subset of docker-cli startup arguments. The problem is that `docker run` command has 96 options and the configuration only uses a handful,
lacking a way to provide the remaining ones.

I think guix should not embed config generators for user software. The only need I see for such generators is when there are options which should be the same among multiple applications (e.g. color schemes or shared directories). For such usecase guix should provide better text
manipulation tools which home owners could use to parameterise
configs.

Best regards,
Sergey Trofimov




reply via email to

[Prev in Thread] Current Thread [Next in Thread]