From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id MKyTIT0SFWeDvwAA62LTzQ:P1 (envelope-from ) for ; Sun, 20 Oct 2024 14:22:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id MKyTIT0SFWeDvwAA62LTzQ (envelope-from ) for ; Sun, 20 Oct 2024 16:22:53 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=WiN4jD9p; dkim=fail ("headers rsa verify failed") header.d=ngraves.fr header.s=ovhmo4487190-selector1 header.b=0ynV9Wnh; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729434173; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=InBe3WFPgqayB1/jDYjJi/YU/tQ+/2dZ4GXnzegxeOw=; b=o9m2eI05NGJjguD72DBTfQ1cSyFpiFJdD0WN+RAX8Um4TG78/8KIFZvN/zQgk0vGv2U/pY BSrOy4FQhIGyMandMTLLppgE9ZNd0QCKsZAzqrpdpCxm2gZLkChnndjN/5iVPhZhdTysGx 1pKbK6Q2Z5K2tM/WqXRqVy9O5w3MMEYyVVIGcvv9EhkzIGaUxFPLOr6wLmguVFAXMnRnXS XudeVvU9pZFP2QsfOdBIquHLujuPZc25v48g8f2RUJq9bwEZUA0SeQkcoL3cEuRYmSF2Hv Gf7plabbX9TuryBJEmYOnZ0zQlnCLaoj4MXps7A1DV324Je94eSWP4h69ET2Ow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=WiN4jD9p; dkim=fail ("headers rsa verify failed") header.d=ngraves.fr header.s=ovhmo4487190-selector1 header.b=0ynV9Wnh; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729434173; a=rsa-sha256; cv=none; b=iHcMfuwhzsjLcZoLWX8u6jYL5NAol8Nbmw1ZhAJavDVXbYaGZ4RA2QJCdbYTu/jT1g0eiw nhBzYl5bN3Acsc1S5NyMTrfoXGTchVPq9/WMZAlydaFTSAdfYD3E67POlGeqYgmO/KT1ic Y7AXvU1cH+roQ1gmUMkhTfMPwA/D10KxG9CQzZQTS4I5QgyYwbBlTm6flf3RU+tMEj5BAH xTaV6nwHJGUIsRUcy1z6BJQg4KRKkjotUlUnzlT/EH++idEiXTzuoOMC/aZpQDDTO6yW2l IlaF3osXjdDjoqjSxgEmeKpW9/onlXOnA4WMFdWD9ibNz1Hi7GG5pxkdn6CgJQ== 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 1997F7DE5A for ; Sun, 20 Oct 2024 16:22:53 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2WpN-00013o-LJ; Sun, 20 Oct 2024 10:22:41 -0400 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 1t2WpL-00013W-UH for guix-patches@gnu.org; Sun, 20 Oct 2024 10:22:40 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2WpL-00060l-LQ for guix-patches@gnu.org; Sun, 20 Oct 2024 10:22:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=InBe3WFPgqayB1/jDYjJi/YU/tQ+/2dZ4GXnzegxeOw=; b=WiN4jD9pK9lBg2OrrNORkQ/VlHxrRL+o16seVqPijW6iOZeUaMesMwyzoQMLwOiWRXzSi6ita685HCZeiBq5+Fb4Eoe6/xKI/e0LRamkRvhwESXG1JMoU8Th1Og/yYRI7r+sgSNzOin0ewxSeHAx8ND/mH56Z+5qY0edLbRRQxbt8xScG5PuxgCCAo414OZr2BSEHBbrXDINOR+yIAu1vcSYDFEGnMjtul2zwSOT6qoAoZQHvoF+/beol7RUnKd1WlMFRDp+X6AOOC8YLj2lxCJJPN9CHESGjeZY81Eb7cPcbmNcsn0xSVPpg0MgUug7zYADeI23/5W7KYslM8orkA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2Wpk-0002W8-Nt for guix-patches@gnu.org; Sun, 20 Oct 2024 10:23:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73876] [PATCH v2 3/3] gnu: databases: Rewrite final-postgresql for postgresql-service. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 20 Oct 2024 14:23:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73876 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73876@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 73876-submit@debbugs.gnu.org id=B73876.17294341539605 (code B ref 73876); Sun, 20 Oct 2024 14:23:04 +0000 Received: (at 73876) by debbugs.gnu.org; 20 Oct 2024 14:22:33 +0000 Received: from localhost ([127.0.0.1]:47963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2WpF-0002Ul-0d for submit@debbugs.gnu.org; Sun, 20 Oct 2024 10:22:33 -0400 Received: from 8.mo575.mail-out.ovh.net ([46.105.74.219]:40975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2Wp9-0002UD-P5 for 73876@debbugs.gnu.org; Sun, 20 Oct 2024 10:22:29 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.2.72]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4XWgcR6QSJz1jvG for <73876@debbugs.gnu.org>; Sun, 20 Oct 2024 14:21:59 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-pbhl4 (unknown [10.110.118.3]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 748341FE5A; Sun, 20 Oct 2024 14:21:59 +0000 (UTC) Received: from ngraves.fr ([37.59.142.109]) by ghost-submission-5b5ff79f4f-pbhl4 with ESMTPSA id 7fWEAAcSFWehwQUASxT0LQ (envelope-from ); Sun, 20 Oct 2024 14:21:59 +0000 X-OVh-ClientIp: 86.246.19.221 Date: Sun, 20 Oct 2024 16:21:35 +0200 Message-ID: <20241020142144.22877-3-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241020142144.22877-1-ngraves@ngraves.fr> References: <20241020142144.22877-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 1299007018261406434 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehjedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekiedrvdegiedrudelrddvvddupdefjedrheelrddugedvrddutdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejfeekjeeiseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=InBe3WFPgqayB1/jDYjJi/YU/tQ+/2dZ4GXnzegxeOw=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1729434120; v=1; b=0ynV9WnhRFTgUAFiAhV0k2dYeVVMLtMRARS2SizJXV372rDEidxQRq2Sqzo8itkePeFxnxEI 4BxaoRD+aM9o3/CeFbXWeDhcc/zuAmVaVyhCJ6L0KFg5F5F8sWY9VgD8LEn5pwo6cw90tEhooPV hut94BjqG6MVNIBQfKdS9MJxyWyBkzopuFGyX9b/DQw8OkGtd/0fJ66LKcbpHQ5tqKyC2zwxGmD fyABzxjJmho4oM5GCayObxWgUCoY0Ul7Uxh2DOSYi8HMJ8tW+HT66POpYHQTQD1cY/UyPBM6hFu mLa5H4TcdK5A1cW5QJMhH9Dwudd9WEHo0P5m/p9WFpB3Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 0.50 X-Spam-Score: 0.50 X-Migadu-Queue-Id: 1997F7DE5A X-TUID: GDqqhxXQCnkm * gnu/services/databases.scm (final-postgresql): Rewrite using a directory-union and rename to extend-postgresql. --- gnu/services/databases.scm | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index fa332d7978..aed0f414ab 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -205,26 +205,13 @@ (define (create-postgresql-account config) (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))))) -(define (final-postgresql postgresql extension-packages) - (if (null? extension-packages) - postgresql - (package - (inherit postgresql) - (source #f) - (build-system trivial-build-system) - (arguments - `(#:modules ((guix build utils) (guix build union)) - #:builder - (begin - (use-modules (guix build utils) (guix build union) (srfi srfi-26)) - (union-build (assoc-ref %outputs "out") - (map (lambda (input) (cdr input)) - %build-inputs)) - #t))) - (inputs - `(("postgresql" ,postgresql) - ,@(map (lambda (extension) (list "extension" extension)) - extension-packages)))))) +(define-public (extend-postgresql postgresql extensions) + (if (null? extensions) + postgresql + (let ((packages (cons* postgresql extensions))) + (directory-union + (string-join (map package-name packages) "+") + packages)))) (define postgresql-activation (match-lambda @@ -250,7 +237,7 @@ (define postgresql-activation (unless (file-exists? #$data-directory) (let ((initdb (string-append - #$(final-postgresql postgresql + #$(extend-postgresql postgresql extension-packages) "/bin/initdb")) (initdb-args @@ -297,7 +284,7 @@ (define postgresql-shepherd-service ((_ mode) (let ((user (getpwnam "postgres")) (pg_ctl #$(file-append - (final-postgresql postgresql + (extend-postgresql postgresql extension-packages) "/bin/pg_ctl")) (options (format #f "--config-file=~a -p ~d" -- 2.46.0