Authentication-Results: mail-b.sr.ht; dkim=pass header.d=yoctocell.xyz header.i=@yoctocell.xyz Received: from mail.yoctocell.xyz (h87-96-130-155.cust.a3fiber.se [87.96.130.155]) by mail-b.sr.ht (Postfix) with ESMTPS id B526811EF72 for <~abcdw/rde-devel@lists.sr.ht>; Fri, 7 May 2021 18:03:32 +0000 (UTC) From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1620410611; bh=ZCHqG9omr+3SNC2WOic0eNxv62YelNInUDrkVg0prws=; h=From:To:Subject:Date; b=HvAUbw8J11hjHcjxTaatObspNw1ri3tl/Cey6gbgOvM4CP0NIdgXyNghYEhicUo1K EguPtXCrB/WVZyJbRjH4l4JCPipxjiBLrC6oupWaWyeLNp88uuktQByLhLnYx4y1oc 82ocrAUmF4dFC+dvxNbXie0Y4S4ZjIT9oScSu2+8= To: ~abcdw/rde-devel@lists.sr.ht Subject: Naming conventions Date: Fri, 07 May 2021 20:03:22 +0200 Message-ID: <87y2cqifpx.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Since Guix Home is still in early phases of development, I thought it would be a good idea to bring up the problem of naming things before we have too many services. This is what the situation looks like right now: * Service types are prefixed with with =E2=80=98home-=E2=80=99, e.g. =E2=80=98home-zsh-service-type=E2=80=99. * Configuration record types are also prefixed with =E2=80=98home-=E2=80=99, e.g. =E2=80=98home-emacs-configuration=E2=80=99. * Extensions for other services don=E2=80=99t really have a consistent nami= ng scheme, some are prefixed with =E2=80=98add-=E2=80=99, e.g. =E2=80=98add-= emacs-packages=E2=80=99, while others are prefixed with =E2=80=98home-=E2=80=99 and end with the n= ame of the target service, e.g. =E2=80=98home-gnupg-activation-service=E2=80=99 prov= ides extension for =E2=80=98home-activation-service-type=E2=80=99. One question is: When should we prefix things with =E2=80=98home-=E2=80=99? Some of the private procedures are prefixed with =E2=80=98home-=E2=80=99, t= his seems a little unnecessary since they won=E2=80=99t be used on other modules, and u= sers certainly won=E2=80=99t try to use them, unless they really know what they = are doing. The configuration record types, e.g. =E2=80=98home-gnupg-configuration=E2= =80=99 don=E2=80=99t necessarily have to be prefixed with =E2=80=98home-=E2=80=99. One of the t= hings we would like to avoid is code duplication with Guix proper, if Guix proper already has a =E2=80=98mcron-configuration=E2=80=99 record type, we = would like to be able to just reuse it instead of creating our own =E2=80=98home-mcron-configuration=E2=80=99 record type. It is the service = type that actually controls how a record type is going to end up in the user=E2=80=99s home environment/operating system. I think it makes sense to drop the =E2=80=98home-=E2=80=99 prefix from the configuration record types. Guix System already has a service for Getmail (gnu services getmail), this could just as well be used in Guix Home, and we could just add a =E2=80=98home-getmail-service-type=E2=80=99 and some helper functions to ma= ke it put the configuration in the correct place instead of having to re-write a =E2=80=98home-getmail-configuration=E2=80=99 record type Another thing I have noticed is that the names for the Shepherd services also start with =E2=80=98home-=E2=80=99, e.g. =E2=80=98home-mcron=E2=80=99.= This seems unnecessary since running =E2=80=98herd status=E2=80=99 will only display the services = for the current user, system services will only be displayed if =E2=80=98herd statu= s=E2=80=99 is run as root. As a side-note: When merging with Guix proper, should we create a new (gnu home-services) namespace or should we just put the services in the (gnu services) namespace? With the latter, we could for example just add =E2=80=98home-mcron-service-type=E2=80=99 to (gnu services mcron) and m= odify =E2=80=98mcron-shepherd-services=E2=80=99 to use a different G-expression t= o start the mcron daemon depending on if it is a system service or a user service. Have a good weekend!