From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +hJ1H41KamFnywAAgWs5BA (envelope-from ) for ; Sat, 16 Oct 2021 05:44:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YGZ0Go1KamGLDAAAbx9fmQ (envelope-from ) for ; Sat, 16 Oct 2021 03:44:13 +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 CD65726705 for ; Sat, 16 Oct 2021 05:44:12 +0200 (CEST) Received: from localhost ([::1]:57984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbacG-0000vO-1R for larch@yhetil.org; Fri, 15 Oct 2021 23:44:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbabw-0000vG-BJ for help-guix@gnu.org; Fri, 15 Oct 2021 23:43:52 -0400 Received: from mout02.posteo.de ([185.67.36.66]:48997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbabs-0006rw-OZ for help-guix@gnu.org; Fri, 15 Oct 2021 23:43:52 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 3A0D3240101 for ; Sat, 16 Oct 2021 05:43:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1634355823; bh=rPyDhAk5MGl24OMrBJskpPeCr7wpAYc8Yg7o3ZaP5Xo=; h=From:To:Subject:Date:From; b=Mn/zgLAP52psvlYuURU6LXV2xqiDSnNYrTZ1aKiB/Hl1Orw38RYlfi7Ho3/795gy2 vElp/QCmnS66RKn0t4F/adhV5nKLC+OZD2Tx7vh4B1FxenGSZkyFrDdz9gLw0OVu60 qPPUcEcHNWFRyNyilv6r7/Zo484xERzFrUsZq9TZsQMIxXXUL/xiELajPGGLhkTubA 2whLfyXTmG2tpfNdfLgDJvmTnWnCjOC7IVa4qoOOi8icyndBUYEchiWrtoPo02N+qQ RPaXlInYvmjNys4So8OzcMoUwtbnSY7DUtaA+tvYOGu5HVIiV7LsjeLKCtiw+M49Lp h2WPsGHpSpa4g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HWTWf1rmGz6tmD for ; Sat, 16 Oct 2021 05:43:41 +0200 (CEST) From: Fredrik Salomonsson To: help-guix Subject: Question about scripts in guix-home Date: Sat, 16 Oct 2021 03:43:34 +0000 Message-ID: <87r1clfxcp.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=plattfot@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634355853; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=m8v5ADTrPqf32cddwyePTiUMhuMWdlz0vHhpQAcXmEc=; b=Zwk04oxa7nAK2QmSBDwiwqCZDGhV8HaBebpO1mcsLpZqZv19qU0Br1mw0WbOnwbc2lDSHM AVgVjVua4k6Nf637lkKPWHoQF9lBBXc19wW+tybH7Mj1d59kwAiLBj83Jt0UCpOjpOCB5M QpO0xq5b3WPjjfudb7efAVF0efWGRiL9bjn9hoiQTgljSOYw6RxNC9LEV0oI1WnGzbPmxr OU1EltiMXvj5aVtEYDfmmQMP9i4SMg5+NZUws8mly1W8hhiRCYE17twnRWdkoFkpPohyOd zlFfT82lxS92aZul7ziofqQnefArNrOJ0RQSeUFXzNXMH1zCL+3I1xUkIg/1gg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634355853; a=rsa-sha256; cv=none; b=IUsdecZUp8drSU8xW77DysThsh2JrqWGm/9T4uTNP23AH7yWz1l73pBY/P2bSyYAkje452 uaNVVCvFlR7h55e1cMGdQwuuDF69jciLtvyvWI1zBdaMAwR0RTazS9k4x2gwMFVPtgxcUF hRXjj9TWXR5mFHfmBHc4TKuy8glyYncE8CeSrMDrilt3Tff3TqDUtYjQFc/IXHLigVu5Wp AsjC3Kh9tqIDa4KQWwcq/pSxnb2D/aPDiC8uDtcXkmElfFqIJOhBafeQwJLUSK8GM5Mb6+ ea/cYnS51cQmfE5bPw+BXc4jV48/vru6gABap4FtjHEv+eWa5tI0cwgqFSKeSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="Mn/zgLAP"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="Mn/zgLAP"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: CD65726705 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: L+KUvQDHKC9C Hi guix, I decided to try out guix home. But I hit a bit of a snag. I'm trying to port my waybar config over to it, but cannot figure out how to set the execution bit on my two custom scripts I have. This is what I currently have: #+begin_src scheme (define-module (plt home waybar) #:use-module (gnu services) #:use-module (gnu home services) #:use-module (gnu packages wm) #:use-module (guix gexp) #:use-module (guix utils) #:use-module (ice-9 format)) (define-public packages (list waybar )) (define %source-dir (current-source-directory)) (define-public (get-services host) "Return services for HOST." (list (simple-service 'plt-waybar-config home-files-service-type `( ("config/waybar/config" ,(local-file (format #f "~a/files/waybar/~a.conf" %= source-dir host))) ("config/waybar/style.css" ,(local-file (format #f "~a/files/waybar/~a-style.c= ss" %source-dir host))) ("config/waybar/modules/mic.sh" ,(local-file "files/waybar/modules-mic.sh")) ("config/waybar/modules/storage.sh" ,(local-file "files/waybar/modules-storage.sh")) )))) #+end_src Which generates the config but the mic.sh and storage.sh bash scripts are missing their execution bit. The bash scripts are really basic, for example here's the mic.sh: #+begin_src bash #! /usr/bin/env bash mic_mute=3D$(pactl get-source-mute @DEFAULT_SOURCE@| cut -d" " -f2) if [[ "$mic_mute" =3D=3D "yes" ]] then echo '{"text": "=EE=80=AB", "class": "muted", "percentage": 0 }' else echo '{"text": "=EE=80=A9", "class": "unmuted", "percentage": 100}' fi #+end_src I played around with gexp but didn't get anything working. Closest I got what by using program-file #+begin_src scheme (define-public (get-services host) "Return services for HOST." (let ((mic-script (program-file "mic.sh" #~(execl #$(local-file "files/waybar/modules-mic.sh"= ) "mic.sh"))) (storage-script (program-file "storage.sh" #~(execl #$(local-file "files/waybar/modules-sto= rage.sh") "storage.sh")))) (list (simple-service 'plt-waybar-config home-files-service-type `( ("config/waybar/config" ,(local-file (format #f "~a/files/waybar/~a.conf"= %source-dir host))) ("config/waybar/style.css" ,(local-file (format #f "~a/files/waybar/~a-style= .css" %source-dir host))) ("config/waybar/modules/mic.sh" ,mic-script) ("config/waybar/modules/storage.sh" ,storage-script) ))))) #+end_src But it's still trying to execute the original scripts and fail due to the execution bit. I'm probably missing something obvious, but I haven't used gexp before. How do you set the execution bit on a file-like object?=20 Or is there a better approach for dealing with these? Package them up perhaps? As I just realized when writing this that I also need to patch the shebang to point to the bash guix-home is using. Thanks --=20 s/Fred[re]+i[ck]+/Fredrik/g