From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8HrkFDjIiGEAggEAgWs5BA (envelope-from ) for ; Mon, 08 Nov 2021 07:48:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id M6aFEDjIiGGIdQAA1q6Kng (envelope-from ) for ; Mon, 08 Nov 2021 06:48:24 +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 A1EB832D46 for ; Mon, 8 Nov 2021 07:48:23 +0100 (CET) Received: from localhost ([::1]:38868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjyS6-0004m2-Ca for larch@yhetil.org; Mon, 08 Nov 2021 01:48:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjyP2-0004aX-5c for help-guix@gnu.org; Mon, 08 Nov 2021 01:45:12 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:40288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjyOx-00011b-FI for help-guix@gnu.org; Mon, 08 Nov 2021 01:45:11 -0500 Date: Mon, 08 Nov 2021 06:44:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1636353892; bh=PHPB3MIxCvOmdzzIEqX4sQpKZLRYlRCaDtHmANbwyOs=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=C/uRLndicQ60/NKHCBuKfixmaFFw4QEgP/LFBizkwDRwj/uwxchB38AoNwBKeiob8 iuIAMpoiD9d2wGoEXAEoNw5roYLAPaQbvkkjH6I0ZEKIJgr1N6GaYT1L679BA4/CFC KazGgLeCPslPzmNMEY7S4CqcOkDqd152xuC54g2E= To: Andrew Tropin From: phodina Cc: help-guix Subject: Re: home-files-service-type file permissions Message-ID: In-Reply-To: <874k8t7lc4.fsf@trop.in> References: <874k8t7lc4.fsf@trop.in> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.131; envelope-from=phodina@protonmail.com; helo=mail-40131.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: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: phodina 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=1636354103; 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-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:dkim-signature; bh=PHPB3MIxCvOmdzzIEqX4sQpKZLRYlRCaDtHmANbwyOs=; b=XhV76MH2n4O4MzbBYg3rumvIpoCehGVBMXgHY+XP2rH670oXhhPaKmYKWNikJOUA6Q/T+1 u2TtB991C//DX3WCvTf+anfRD97zYljdhc/F6AApJl2MWpDLiyaeNARZ1lHI1253qQ8ylc EXRQXHQVtQvxHypgRq2Bs0mxo6AKJkciqOCp1wvFPlLe99L4U1h5q73YLLynJGm32o+QFK WFdqi7TDyoq98ZBhs1i70yf6c0Qnsx/lWENQFCGEmRrA4LKlAzqBdDnj9O2/VOppmC0dcv gTW0GMwPqfiKNLsrGqnd5Ci0wcIg3NbvZ1eIY/aRRivrPSxc16BRIvleWyi+9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636354103; a=rsa-sha256; cv=none; b=kfwBJGyUFRcl3v3zz4mzMJq/TmjYlRDOgw2yCqPuoBs0Dpv4Mhn+wUPtAd34y8OoCQ40MF O3opnShwFZuFb9Y6ownY6Q+Xw0T/Z+lsAqDZ1BMALENtTvy5c0WhpDNH1K+Y0Iit6GSvhe WKNH3oM76vkDYu4Dw2VjN7nNhkX2U53k604nKyaNUKu12eBn7LbSCZ2YwFfXl5ywhtd5XD kFz3BQ0bfokDQtY6awimZBqy/SDUCmHk2ETErhzIyFEBWaLbvxWvTa9uEp0Xb3TMHvHP8a zpaezsfrgxfS94tcQQHtK2I7WqVeybyZbtleURT6JTnDMkZ5T234SsJa4Q/iFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b="C/uRLndi"; dmarc=pass (policy=quarantine) header.from=protonmail.com; 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: -1.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b="C/uRLndi"; dmarc=pass (policy=quarantine) header.from=protonmail.com; 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: A1EB832D46 X-Spam-Score: -1.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: MaiwYP94BIoT Hi Andrew, On Wednesday, November 3rd, 2021 at 8:24 AM, Andrew Tropin = wrote: > On 2021-11-02 11:31, phodina@protonmail.com wrote: > > > Hi Andrew, > > > > Thanks for the development of Guix home. I've recently switch to it fro= m my dotfiles. > > > > However, there is one thing that I do not know how to set. > > > > When using the service home-files-service-type I encountered a situatio= n where I'm copying a script: > > > > (simple-service 'dotfiles > > > > home-files-service-type > > > > (list > > > > ... > > > > `("config/sway/wallpaper-change.sh" ,(local-file "config/sway/wallpaper= -change.sh")))) > > > > However, after guix home reconfigure the file has only read flags set n= ot execute. Even though the original file has execute flags. > > > > Is the home-files-service-type the correct service to use? > > > > Petr > > If there is no specific home service for your use case, which generates > > all necessary configs and executables for you the answer is probably > > yes, using home-files-service-type directly is a way to go. > > > Or do I have to patch it in order to keep the permissions? > > AFAIK, local-file, mixed-text-file create non-executable files in the > > store by design. Thanks, I've now looked more at the implementation and spend time understan= ding the differences between local-file, plain-file, computed-file, program= -file. > > If you want to make an executable file you have at least a few options: > > 0. You can use recursive? flag to keep permissions. > > (local-file "blabla" #:recursive? #t) > Nice and simple solution. > The quote from documentation: > > > if file designates a flat file and recursive? is true, its contents > > > > are added, and its permission bits are kept. > > http://guix.gnu.org/en/manual/devel/en/guix.html#index-local_002dfile > > 1. Use program-file > > http://guix.gnu.org/en/manual/devel/en/guix.html#index-program_002dfi= le > > For example I do it for generating screenshot scripts: > > https://git.sr.ht/~abcdw/rde/tree/master/item/rde/features/wm.scm#L18= 8 Thanks for this example! This is what I've been looking for. > 2. Use computed-file, which will call chmod with apropriate arguments > > inside gexp. Take a look at "empty-tree" example in the manual, you c= an > > create a file and set apropriate permissions in the same way. > > -- This is also super useful as it allows to do what's needed to the file. > > Best regards, > > Andrew Tropin