From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ED5ADYxH9F+hcwAA0tVLHw (envelope-from ) for ; Tue, 05 Jan 2021 11:03:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KCscCYxH9F8FQwAA1q6Kng (envelope-from ) for ; Tue, 05 Jan 2021 11:03:40 +0000 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 E1C639404D0 for ; Tue, 5 Jan 2021 11:03:39 +0000 (UTC) Received: from localhost ([::1]:50090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwk7m-0003HO-PO for larch@yhetil.org; Tue, 05 Jan 2021 06:03:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwk71-0003H6-Mu for guix-devel@gnu.org; Tue, 05 Jan 2021 06:02:51 -0500 Received: from mail4.protonmail.ch ([185.70.40.27]:18334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwk6y-00075p-Tg for guix-devel@gnu.org; Tue, 05 Jan 2021 06:02:51 -0500 Date: Tue, 05 Jan 2021 11:02:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609844565; bh=LoSmHWaTkSGeSdZDzcRPChwA5zQUrMF5gIn3zZKTdcc=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=UFy31CDPfQkq3+QU0/dInbwnyp1WU4Gxa8gJEDif/qYvaoJcHLoTcimmVHY603RPp J8srF7LfKIWbJTN7px1izZJaiJZG23qrYmNTJm2r6aO/KKfEJZAKT5suug/6pkCCMv Ye/rRN3NsJGPTeyiOzWFxf0eQASWwkTluHsfv6Hk= To: Carlo Zancanaro From: raid5atemyhomework Subject: Re: ZFS on Guix Message-ID: In-Reply-To: References: <_1CLe9QSGsoMlu5WxBMXm4CbFLM_M9iRG1XQF9GDsK0GP208jpngdymfix4tAfoLP94mhMTt-Tx6OP2xN_n78Jhx5KQzkiqPpIci_44C9OI=@protonmail.com> <4nnVFhbpUhipplsq55mHX9KtoMK9s0rZDC3D8rgKQ5O0nUtnapdkHZfPcAVpECgW1mnYm1BbmvyQ4SyTgvNyUgVgzM29gh6b8OL7p3YvczM=@protonmail.com> <20210103165008.6517c1bf@scratchpost.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.27; envelope-from=raid5atemyhomework@protonmail.com; helo=mail4.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Cc: "guix-devel@gnu.org" Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=UFy31CDP; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: E1C639404D0 X-Spam-Score: -3.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: 69Hba9vC7PT5 Hi guix-developers, In https://lists.gnu.org/archive/html/guix-devel/2021-01/msg00053.html Carl= o mentioned to instead use the `service` system to modify all parts needed = in the operating system to get ZFS installed, and noted as well that the on= ly thing missing in the `service` system is the ability to push kernel modu= les into the operating system. Here's a sketch of an attempt to add that feature so we can conveniently ad= d ZFS on Guix by just adding a `(service zfs-service-type...)`. First, we need a new `kernel-loadable-module-service-type` in `gnu/services= .scm`: ```scheme (define kernel-loadable-module-service-type ;; A service to add the kernel modules of a package. (service-type (name 'kernel-loadable-module) (extensions '()) (compose concatenate) (extend append) (description "Register kernel modules that will be placed i= n a loadable place where the kernel can find them.") (default-value '()))) ``` Absolutely no idea if a `'()` extensions makes sense but *shrug*. Then, in `gnu/system.scm`, we create this new function: ```scheme (define (operating-system-all-kernel-loadable-modules os) ;; Gathers the kernel-loadable modules in the KERNEL-LOADABLE-FIELD ;; field of the OS, as well as those registered by services. (let ((service (fold-services (cons (service kernel-loadable-module-servi= ce-type '()) (operating-system-user-services os)) #:target-type kernel-loadable-module-servic= e-type))) (append (service-value service) (operating-system-kernel-loadable-modules)))) ``` Does that make sense? Am I misusing `fold-services` and `service-value` her= e? Onward, we modify as well the function `operating-system-directory-base`: ```scheme (define* (operating-system-directory-base-entries os) "Return the basic entries of the 'system' directory of OS for use as the value of the SYSTEM-SERVICE-TYPE service." (let* ((locale (operating-system-locale-directory os)) (kernel (operating-system-kernel os)) (hurd (operating-system-hurd os)) (modules (operating-system-all-kernel-loadable-modules os)) ;... ``` The above is the reason why we need to `cons` a synthetic `kernel-loadable-= module-service-type` service, the function `operating-system-directory-base= -entries` is used do create the default for `operating-system-essential-ser= vices`, and the `operating-sstem-services` is just the concatenation of the= user and essential services. I think. Would this work? Thanks raid5atemyhomework