all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Murad Mamedov <muradm@encom.net>
To: Sergey Trofimov <sarg@sarg.org.ru>
Cc: guix-devel@gnu.org
Subject: Re: Are declarative app configs worth it?
Date: Wed, 27 Dec 2023 07:15:48 +0300	[thread overview]
Message-ID: <878r5g6yhe.fsf@encom.net> (raw)
In-Reply-To: <874jg5hvz7.fsf@sarg.org.ru>


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



      parent reply	other threads:[~2023-12-27  4:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 13:53 Are declarative app configs worth it? Sergey Trofimov
2023-12-26 14:56 ` Ricardo Wurmus
2023-12-26 15:05   ` John Soo
2023-12-26 15:18   ` Nguyễn Gia Phong via Development of GNU Guix and the GNU System distribution.
2023-12-26 16:50     ` Ricardo Wurmus
2023-12-27  1:34       ` Nguyễn Gia Phong via Development of GNU Guix and the GNU System distribution.
2023-12-26 15:39   ` Attila Lendvai
2023-12-26 16:49     ` Ricardo Wurmus
2023-12-27  7:38   ` Sergey Trofimov
2023-12-28 14:28     ` Efraim Flashner
2023-12-27  4:15 ` Murad Mamedov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r5g6yhe.fsf@encom.net \
    --to=muradm@encom.net \
    --cc=guix-devel@gnu.org \
    --cc=sarg@sarg.org.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.