From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GOYmCHbx42MKJQAAbAwnHQ (envelope-from ) for ; Wed, 08 Feb 2023 20:01:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oCQRB3bx42PEDgEAG6o9tA (envelope-from ) for ; Wed, 08 Feb 2023 20:01:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1200660D2 for ; Wed, 8 Feb 2023 20:01:08 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPpgP-0003BW-Ts; Wed, 08 Feb 2023 14:00:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPpgN-0003Aj-Fs for help-guix@gnu.org; Wed, 08 Feb 2023 14:00:39 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPpgL-000107-Ej for help-guix@gnu.org; Wed, 08 Feb 2023 14:00:39 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 31F85287; Wed, 8 Feb 2023 20:00:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w8fWz2IC8-6F; Wed, 8 Feb 2023 20:00:32 +0100 (CET) Received: from jurong (unknown [IPv6:2001:861:c4:f2f0::c64]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7092D1E3; Wed, 8 Feb 2023 20:00:32 +0100 (CET) Date: Wed, 8 Feb 2023 20:00:31 +0100 From: Andreas Enge To: "mhrunnels@yahoo.com" Cc: "help-guix@gnu.org" Subject: Re: Understanding config.scm Modules Message-ID: References: <484018477.1836111.1675364529911.ref@mail.yahoo.com> <484018477.1836111.1675364529911@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <484018477.1836111.1675364529911@mail.yahoo.com> Received-SPF: pass client-ip=2a0c:e300::1; envelope-from=andreas@enge.fr; helo=hera.aquilenet.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675882869; a=rsa-sha256; cv=none; b=Obyl0BZ61HpHaXQsnsxiXE0xnfgg97KD6BL5x3OY4lQDkvrGUu2bHwruayNUy+y1LXRbR/ q+6tTV+r9qCbjUi/AyKg92fmIYmj7/EoN0aUV0jLZp4SucE+E2gV+OqFV7Hh7hWIrWipla jQpTGEZrp03tD/ZhyHI81gYbr82Wvs4YO8IT4rIxBvX4b3EKLEyw8hcX1aPamHm3LDF9NG BFwoHPWeQvNEeqncIsTuDILtKsAPCyySbhDJkcBhKCfiQqqt4LGt/woAKq7mhTP7zi+3Xx zjk4tuwmXKGR/SbvXkOQbrEsed/xxUeCUZ7gwrOEKOeZ26gVLTFHzv+hofPhDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675882869; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jnD1BjIgvDVotdmG9qr1bzJ2y7JodXfY63pLrU9J+cs=; b=XEgVssIMc06mIGtOpjE0n1z3200zgKcqRc4R590EeHHge8EGiiryyseRQDs5WEPRyY8iUI Q3zAVAx+E851KMSA2muibAkCcBlQH+bpWD1HdQGLGzcgaWv8yrwzk4+Cf1bPcM4DaVlkdH a5FfwRSyxQSQWPvBA018BWqcNxwKUhpCaW1JsKxWE3IYjMI8/3QJqB7/N90D9ROGgjnlDQ lX0lPW0Fq2g2YTKPhJ4BASlW+l32Y3LAUPgkn0Z+5u6tMz/tNk3w7Aa7JghSHYgIDSP86T AOSZ0PX5dtbVMjYbD2dFtlhMMu7BlZLESNce0RX6AsNN66eB404fh2/SoG8IPQ== X-Migadu-Queue-Id: 1200660D2 X-Migadu-Spam-Score: -2.40 X-Spam-Score: -2.40 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: QozGeibpSjJh Hello, Am Thu, Feb 02, 2023 at 07:02:09PM +0000 schrieb mhrunnels@yahoo.com: > With the help of Timo Wilken and Paren, I have a working system and am endeavoring to configure Guix to meet my needs.  That said, I am struggling with the Guix manual.  While written well for Guix experts, the manual is a challenge for non-developers and neophytes.  What follows is a practical example of my consternation. nice that you got the system set up, and cudos for taking the time and sharing your critique with us. Unfortunately I will mainly reply to the easier parts, like my predecessors ;-) > 2) For example, what is the purpose of "use-modules", "use-service-modules", and "use-package-modules"? Beware that although the system description looks just like an ordinary text file (much like a configuration file), it is actually a piece of programming written in Guile/Scheme. So when my configuration contains something like (services (append (list (service xfce-desktop-service-type) (service cups-service-type (cups-configuration (web-interface? #t) (extensions (list cups-filters hplip-minimal)))) ... the last entry "(service cups-service-type" etc. defines a printer service from the Scheme variable cups-service-type, which is defined in a module; which I need to include by (use-service-modules cups) Or the xfce-desktop-service-type by (use-service-modules desktop) Or both in one by (use-service-modules desktop cups) The modules correspond to files; for instance, the service module cups is a shortcut for the module (gnu services cups), which you find in the file gnu/services/cups.scm. Something similar holds for package modules, but one can do things more easily. I have this: (packages (append (list (specification->package "nss-certs") (specification->package "vim")) %base-packages)) Here the line (specification->package "vim") returns the Scheme variable corresponding to the package with name "vim"; I think one could obtain the same just writing vim, but would then need to write (use-package-modules vim) as a shortcut to (use-modules (gnu packages vim)) > 3) Where does the manual explain the options to be included or excluded with "use-modules", "use-service-modules, and "use-package-modules"? > 4) Where does the manual list the modules and module options for quick reference? Watch out, there are no module options: use-modules, use-service-modules and use-package-modules are just followed by an arbitrary number of modules (like cups and desktop above). The way I go about it is to usually (and quite systematically) forget the inclusion of a module; then most of the time Guix emits a helpful warning message, and then I add the module as told. Alternatively, for services, they are documented in the manual. Say you are interested in printing: https://guix.gnu.org/manual/en/guix.html#Printing-Services It starts by stating "The (gnu services cups) module ...". So you will have to do a (use-modules (gnu services cups)) or (use-service-modules cups) > Finally, I have invested over 40 hours reading the manual and other supporting material.  So, for the "RTM" crowd, I think that time investment reflects a commitment to learn and understand the Guix system. Accordingly, I look forward to hearing from those that can "fill in the gaps" missing from the manual or direct me to the specific resources necessary for me to comprehend what I don't understand.  And as a new Guix user, I am more than willing to contribute by assisting those working to improve the documentation.  A noob to help noobs, if you will indulge the thought. I hope you enjoyed the manual and did not feel like you wasted your time! Otherwise feel free to suggest changes. > PS - once this knowledge "hump" is conquered, questions on the mysteries of %base-services, %base-packages and %desktop-services are next on my list. > ;; Current Guix Operating System Configuration >   ;; Packages Appended to %base-packages >   (packages (append (list (specification->package "awesome") >                           (specification->package "nss-certs")) >                     %base-packages)) Maybe I can try to answer a question before it is asked ;-) %base-packages is a predefined list of packages, that the Guix people thought would probably be needed all the time. It is in gnu/system.scm: (define %base-packages ;; Default set of packages globally visible. It should include anything ;; required for basic administrator tasks. (append %base-packages-artwork %base-packages-interactive %base-packages-linux %base-packages-networking %base-packages-utils)) It is the concatenation ("append") of the more specific lists of packages %base-packages-artwork and so on, which are given just a few lines before. And in your operating system definition you do a similar thing, you create a list with two packages and concatenate it with this predefined list. >   ;; System Services List >   ;; Services Appended to %desktop-services >   ;; Services Search - Run 'guix system search KEYWORD' >   (services (append (list (service tor-service-type) >                     (service cups-service-type) >                     (set-xorg-configuration >                     (xorg-configuration (keyboard-layout keyboard-layout)))) >                   %desktop-services)) Same principle! Andreas