From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kau+Jv7kiGG8MwAAgWs5BA (envelope-from ) for ; Mon, 08 Nov 2021 09:51:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2Jq7If7kiGE9GAAAB5/wlQ (envelope-from ) for ; Mon, 08 Nov 2021 08:51:10 +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 C6B7F34947 for ; Mon, 8 Nov 2021 09:51:06 +0100 (CET) Received: from localhost ([::1]:55110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk0Mr-0004bo-VT for larch@yhetil.org; Mon, 08 Nov 2021 03:51:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk0MR-0004a2-SQ for help-guix@gnu.org; Mon, 08 Nov 2021 03:50:39 -0500 Received: from [2a00:1450:4864:20::534] (port=43668 helo=mail-ed1-x534.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk0MH-0003bv-67 for help-guix@gnu.org; Mon, 08 Nov 2021 03:50:32 -0500 Received: by mail-ed1-x534.google.com with SMTP id w1so59726947edd.10 for ; Mon, 08 Nov 2021 00:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=nRH3mE8mFcWDfxwH9ZwVACv60Do6uexeEo1MeUQdack=; b=G4iwbIeil/aJLZCKs8bDKhg1E60rsZMSLOp6bPJuoY4YTkDEXQvGBG3Wh0cakh397e WmBoou6BsxHHPFOORW2VEVw4couVbRDprGsu4dxOWx/pv8FSeKwp8nDtstJ9CX4UigG2 baOK2ygdtt/ZyT5y5C3b/17aSp0VVtfVwMFyfAHZXSxkSEUrB+xB9cta0QBKNQJUC2sQ zueEuHXIxl0IFptGLUZhE812b1lBoDv0vX6JytCHJ5qmQlFWU9SA+xLyHwQLnopZVxT8 8I64PR5vbivsv1Cj6UU3Q1kWPV7CvYj2iCkMB7FQTgo/1F+f28hV7UIa+XrKo0oJuAus h7FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=nRH3mE8mFcWDfxwH9ZwVACv60Do6uexeEo1MeUQdack=; b=b7wE9s4a2We7u8dKLialzO25Ch61Uy08HH2RKe0zUk5qbUtD6XOmKATMNRWF1Pey84 o6GvOMtxqkjrpRbMOPdhkA6iZvHmR5WsMgzZ+CHEWvvmHzesu1U+pmvmpPWvDmDjFZdq MpDDqlMLw3/vfIfjhGqb5rnK0qgrRI1EdKatZPJ3Xur57FZUWxWM5ZgapqfWsWTwoMuf QfM4oZ0yo/XgfQQ47MEnlF5SDc1dON2MIuGyQsB2UgvKj1uEVctFxm4DpFj1Q7WG+d38 QxDnsyo/dK3gA6O8bt707q37qu62WSymqDhyUbzxghs/C7KG0Bi4ozbgW45E3RFTyQrR ONZQ== X-Gm-Message-State: AOAM533MwcNxR5nzfJfwVMKVLB/6ujvaC4nY+tXsGqaQMqziRUanBQVs LG9OvnOdSWNFivKIFluJb7ERuFzIMFzLnw== X-Google-Smtp-Source: ABdhPJwX9TTLgEuI81SXWbsXSrI27PeqCTkuud+pw9f+cHrlxJsjPK0jctl4QFXKaH5Uhz4XY+R0uA== X-Received: by 2002:a2e:7216:: with SMTP id n22mr24332160ljc.452.1636360946024; Mon, 08 Nov 2021 00:42:26 -0800 (PST) Received: from localhost (109-252-141-7.dynamic.spd-mgts.ru. [109.252.141.7]) by smtp.gmail.com with ESMTPSA id c4sm1355326ljd.10.2021.11.08.00.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 00:42:25 -0800 (PST) From: Andrew Tropin To: phodina Subject: Re: home-files-service-type file permissions In-Reply-To: References: <874k8t7lc4.fsf@trop.in> Date: Mon, 08 Nov 2021 11:42:22 +0300 Message-ID: <87r1brghsh.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::534 (failed) Received-SPF: none client-ip=2a00:1450:4864:20::534; envelope-from=andrew@trop.in; helo=mail-ed1-x534.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: help-guix 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=1636361466; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nRH3mE8mFcWDfxwH9ZwVACv60Do6uexeEo1MeUQdack=; b=AJIAnZ9v/hbCGIlUZXud9o2euqN8fGF0MBqEitmn42UIQJXcI5MzJdjy5lRW6uNa6SHA/K lqUYvOucvov1b6XZcuH8oSvQl2Ar58vaCIUvLP3ylG5T3MmvL/k1suF3E2h9kWou2UGzGB d8aMJnsXeAGgWF7olS+wGqeCneZ7Wzi7dxm7KLg0K+e+d+q3jQZWJN3q76x0RLhpHvtXbJ L2G8GDEgWdjZaEfOaydSQmc957fVX8FTMLW3hwSB0jllxz66JEXLRJoxyr/mgjZa44JLyi SNDMFE0QA9IUPOZ/Roiuk6GnWhzh9GWlPO7CWz20oI7Zy4s/QVp6/GdyU3BcnA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636361466; a=rsa-sha256; cv=none; b=lO11fvIWYBxOLyIJhrx1kpt3yRemG7ysXgeg/CGfe3i0y5gygaM+bsLr7txPiF4997PFk4 SA+O/CWN+S96ZGcoSrn00AEcxHTTXAGG6ahk1SW6JlqWZ5LvjojHOg84PvgAvcKq+DxPVI WlynZa07Y7L2GMBBR1Hu+tGKbwpzx79Myj4KtWkN7KEhqPldrEPMgKuMObScleoJoxWbEV LONMLtXkz8XK2YmQWhcHlRgj56gq2ngQ0yMKsv/2B4Ih31EuAqNmNEhTPOs13JG1HyqDgb vNuhm6D8du8t7lu/NtmubAPHj3rwliapyBxqWsce6VfzWPGYKzUlCqBte5P6yA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=G4iwbIei; dmarc=none; 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: -0.72 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=G4iwbIei; dmarc=none; 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: C6B7F34947 X-Spam-Score: -0.72 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4BqIA6GPe65M --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2021-11-08 06:44, phodina wrote: > 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 fr= om 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 situati= on where I'm copying a script: >> > >> > (simple-service 'dotfiles >> > >> > home-files-service-type >> > >> > (list >> > >> > ... >> > >> > `("config/sway/wallpaper-change.sh" ,(local-file "config/sway/wallpape= r-change.sh")))) >> > >> > However, after guix home reconfigure the file has only read flags set = not 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 underst= anding the differences between local-file, plain-file, computed-file, progr= am-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_002df= ile >> >> For example I do it for generating screenshot scripts: >> >> https://git.sr.ht/~abcdw/rde/tree/master/item/rde/features/wm.scm#L1= 88 > > 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 = can >> >> 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 Sure, glad to help :) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmGI4u4ACgkQIgjSCVjB 3rA69Q//aoozf5MAuYrwgg36sxF6Pig9hqHdQW/M9TV7v/8v4x74tstgss34GCaU rpFRvEXYPg59X4Nkz5rzY5uqJadq8OEe4MzTPVt16kLt38QEf4s6NiaqNNexk8YM f6RmX3PthF2pyFzNO2yHa2SLWTqIQR4Jv7Rwtu2ZRsSRSju8EDww3e4NE0+t93pX DViGRa+Y/9Sgso9iwLbOPSinZprD8W3I/cCtgCzZs9B2elmhQQd9IeKk79TToyRx rGyq9nJQelIPTZuMaXWkNYnhX4vymSCYm+ZHqwsuspFji3Xiusl2vgyA7SSpCJ0Q 2laAFfaEQRzZq6TakPufWCPdC9V2KQ8/DfXNAw/HOauQBlTaNjc7zxwyOVpEOIco 8MFM5H6xF8C8JKnffbRvbWrHiKUjrGUNOw+KvaAYAUeiTJ3MFO4pi1alOu/6Eizb XtQYd3hvHwn3uKK6RYnbHXB9Ovon3gXyT4FpennFPeBcei4oth7KeOzURTbZmEWI pD8NrxzqCFd21r6K8AeOWsg9VQS8A84R0regCWpoFeltsaFcTuWw7I3f9m2LsGEj jMuvqNx/3+m60Ao1rgdr0l6/9Eniyh05IAaSzYQM/iVEMYhifFSiHJp/yPkuM/3+ /yH8licI4fJ4zzRY5Y6uiyDaVcLNblEv9VpspjAHmqOdfWoyEbs= =0UOB -----END PGP SIGNATURE----- --=-=-=--