From patchwork Mon Mar 31 01:14:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Wong X-Patchwork-Id: 41048 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 30CED27BBEA; Mon, 31 Mar 2025 02:15:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A3D9627BBE9 for ; Mon, 31 Mar 2025 02:15:27 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tz3k2-0003Sm-1y; Sun, 30 Mar 2025 21:15:06 -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 1tz3k0-0003Qa-Cn for guix-patches@gnu.org; Sun, 30 Mar 2025 21:15:04 -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 1tz3jz-0001er-PL for guix-patches@gnu.org; Sun, 30 Mar 2025 21:15:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=dJ4j8OgWssK+H+SCvof9R+urgIeiMFP2tD6rXThC+Mo=; b=qGu98/MPkG8/7+Aykl5MAWmEbbeFvp/2WfAyzqKb1wzCIRUBm1Fl9NYVKymJqUZsjlfeirGl+neDjrK5u3K6/YMjAu57sGN0WySTVRYfrCnWDBMcMIHDekoyIIREbnrFBXKhsosWKTqTmlI2ong3OvjxWVdj9Mj7yXPDJ/6G3EgsK0u8ck4t4TucnL2wLkM1xq0mTi+SnQddLlF1Ydd7nnqnr7RFE4fqabjKRQ/JD7dCvacJLT7AxSFwaJ5NJ3NYmuxHpwTxb0zE7TU/pxmQWSlwaEl6qL4ng/HcvNUUOWatnW00nuuW4cOVGtQF0z0PnbUsToNXxC6Vzgqvdfo4lw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tz3jy-0000b1-If for guix-patches@gnu.org; Sun, 30 Mar 2025 21:15:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77352] [PATCH v2] home: services: define hyprland home service Resent-From: Andrew Wong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 31 Mar 2025 01:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77352 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Carmine Margiotta , 77352@debbugs.gnu.org Cc: ludo@gnu.org, janneke@gnu.org, tanguy@bioneland.org, andrew@trop.in Received: via spool by 77352-submit@debbugs.gnu.org id=B77352.17433836882169 (code B ref 77352); Mon, 31 Mar 2025 01:15:02 +0000 Received: (at 77352) by debbugs.gnu.org; 31 Mar 2025 01:14:48 +0000 Received: from localhost ([127.0.0.1]:38578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tz3jj-0000Yt-Hc for submit@debbugs.gnu.org; Sun, 30 Mar 2025 21:14:48 -0400 Received: from qs51p00im-qukt01071501.me.com ([17.57.155.4]:48895) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tz3jg-0000Xm-NQ for 77352@debbugs.gnu.org; Sun, 30 Mar 2025 21:14:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=dJ4j8OgWssK+H+SCvof9R+urgIeiMFP2tD6rXThC+Mo=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:To:From:x-icloud-hme; b=E5cvlO5Ce4B/KlUiC4pALh8Tm9CjMbrMFJODfn3+RnaD+evkS6dnzK61gWsQ1Z21f zBE+G1z1iNVb/K5m2bZplkt74N1DhYW+VUPkELUHzqpS8F33LeS6TS2uxHDz1bvnBv 5k1+IDwjaShvlHOeNdfSm8AJQygSpPf4Op6sYaHrXLwSASrBHsuxdw8NFKg7cL0y3D yBkx0CU5P58qiab3T7YkzlnLnfqtnz7Vmgm2gEgiAMAL4Hmm6P83V+vhOxSRpUm3/O Znr0xLV/ff7yQ0V/HCZExhZxhUNeM0ewaqKpgJsWVtJ7WxF7k2NUZyioS3yZX2Gcv0 8ySyW7pPGprWQ== Received: from [192.168.86.109] (qs51p00im-dlb-asmtp-mailmevip.me.com [17.57.155.28]) by qs51p00im-qukt01071501.me.com (Postfix) with ESMTPSA id 341D21C401B3; Mon, 31 Mar 2025 01:14:37 +0000 (UTC) Message-ID: <88ab5741-089a-4cd3-bad5-e4cac1f039ef@icloud.com> Date: Sun, 30 Mar 2025 21:14:35 -0400 MIME-Version: 1.0 User-Agent: Icedove Daily References: <20250328232510.32282-2-email@cmargiotta.net> <20250330171201.16566-1-email@cmargiotta.net> Content-Language: en-US In-Reply-To: <20250330171201.16566-1-email@cmargiotta.net> X-Proofpoint-GUID: 2kkveeDPJT0w7KY_vn5nRP5MEkcyzXa4 X-Proofpoint-ORIG-GUID: 2kkveeDPJT0w7KY_vn5nRP5MEkcyzXa4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-30_11,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 mlxlogscore=999 clxscore=1011 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2503310007 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: Andrew Wong X-ACL-Warn: , Andrew Wong via Guix-patches X-Patchwork-Original-From: Andrew Wong via Guix-patches via From: Andrew Wong Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello, I've suggested some small changes which I've attached as patches. I also have some questions and comments: On 3/30/25 1:11p, Carmine Margiotta wrote:> +;;; Gexp executables will be serialized on a program-file > +(define (serialize-executable name value) > + (if (string? value) value > + (program-file (symbol->string name) value > + #:module-path %load-path)) How will you serialize g-expressions? It seems that they are to be added to the store as scripts with 'program-file', but I can't figure out how to extract the file path from the resulting object; I tried in a REPL, program-file objects cannot be used as strings like this function seems to suggest, and none of the their properties seem to clearly give their location in the store. Also, how are you testing your work? I asked in the IRC channel and they suggested spooling up a VM via 'guix system vm' with an operating-system definition containing the experimental service, but perhaps you have your own method. From 70dd0149f777eae9f4ea4a4c7d92ca058b1e76bf Mon Sep 17 00:00:00 2001 Message-ID: <70dd0149f777eae9f4ea4a4c7d92ca058b1e76bf.1743381801.git.wongandj@icloud.com> In-Reply-To: <0d2c72441d9b4a94aded6d53028d63b253f5e7ae.1743381801.git.wongandj@icloud.com> References: <0d2c72441d9b4a94aded6d53028d63b253f5e7ae.1743381801.git.wongandj@icloud.com> From: Andrew Wong Date: Sun, 30 Mar 2025 17:20:31 -0400 Subject: [PATCH 5/5] home: services: hyprland: Localize 'indent' home: services: hyprland(serialize-block-entry): Localize 'indent'. home: services: hyprland(indent): Delete. home: services: hyprland(repeat): Delete. Change-Id: Id36e4eac964bf424ac4f8e2b411d69da402d9b5b --- gnu/home/services/hyprland.scm | 52 +++++++++++----------------------- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/gnu/home/services/hyprland.scm b/gnu/home/services/hyprland.scm index cade4402ac..36e5ae951a 100644 --- a/gnu/home/services/hyprland.scm +++ b/gnu/home/services/hyprland.scm @@ -42,23 +42,6 @@ (define-module (home home services hyprland) ;;; ;;; Code: -;;; -;;; Helper functions. -;;; - -;;; Repeat v n times -(define (repeat v n) - (if (eq? n 0) - '() - `(,v ,@(repeat v - (- n 1))))) - -;;; Generate an indenter string of n tabs -(define (indent tabs) - (if (<= tabs 0) "" - (apply string-append - (repeat "\t" tabs)))) - ;;; ;;; Definition of configurations. ;;; @@ -242,25 +225,22 @@ (define (serialize-block-entry value tabs) (() "") (((? symbol? name) value) - (string-append - (indent tabs) - (symbol->string name) - (match value - ((? string? v) - (string-append " = " v)) - ((? number? v) - (string-append " = " - (number->string v))) - ((? boolean? v) - (if v " = true" " = false")) - ((? block-entries? v) - (string-append - " {\n" - (serialize-block-entries - #f v - (+ tabs 1)) - (indent tabs) "}"))) - "\n")) + (let (indent (make-string (max 0 tabs) #\tab)) + (string-append + (indent tabs) + (symbol->string name) + (match value + ((? string? v) + (string-append " = " v)) + ((? number? v) + (string-append " = " (number->string v))) + ((? boolean? v) + (if v " = true" " = false")) + ((? block-entries? v) + (string-append " {\n" + (serialize-block-entries #f v (+ tabs 1)) + (indent tabs) "}"))) + "\n"))) ((_) #f)) "\n"))) -- 2.49.0