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 IGPaJPQsrWH+YgEAgWs5BA (envelope-from ) for ; Sun, 05 Dec 2021 22:19:48 +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 iAmPIPQsrWE7RgAAB5/wlQ (envelope-from ) for ; Sun, 05 Dec 2021 21:19:48 +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 3CC222FC65 for ; Sun, 5 Dec 2021 22:19:48 +0100 (CET) Received: from localhost ([::1]:38732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtyvD-0001dO-Cy for larch@yhetil.org; Sun, 05 Dec 2021 16:19:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtyue-0001cw-L4 for help-guix@gnu.org; Sun, 05 Dec 2021 16:19:13 -0500 Received: from [2607:f8b0:4864:20::b2b] (port=35727 helo=mail-yb1-xb2b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtyub-0006tW-NT for help-guix@gnu.org; Sun, 05 Dec 2021 16:19:11 -0500 Received: by mail-yb1-xb2b.google.com with SMTP id f186so25798002ybg.2 for ; Sun, 05 Dec 2021 13:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K0uJET0O1tYljjVXsfkwj3ms95E0bWlvQhRuFgIMoJE=; b=e6J6V0b6nao0rqrbjvLa1OY6ddkByv6MwM1MNbE6Em5HLlc91yUHngLaq4RvkpAIxZ B8MZFrTWRB8TSmTMhVX+j2ZZJyOoqMSjDPMlz7Rp19EnS5OsSdZjt5C3LI1I127JLkby 9QaWGWbXzguNe26HjoTAAiPtsW2gAEarTGuO4fBI6YJU1rzrxU+u1ncCFcJ7sqm6M52B zKetd8wYysLVJwTdimh0avvHdWHhlHHFeknjUt3M+3oUA2iFEgb3POND42//DPVJGJBs 3uBDirOKDuoJxnXFfmzT0PFKJ106PrBsS5dXq93RPBTApIyLDYKH/3NpUjCHNBFhWW0M mafQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K0uJET0O1tYljjVXsfkwj3ms95E0bWlvQhRuFgIMoJE=; b=thbtEqqb+2UsBR4b61V4pd9uwh/hiaedy+mxFccoZ4jgmo/oGoY5Lre4SkSty6i2hC y5i9hRlqNBzltJyZw+ECy/PEWVtjSLaMU7dLCZIR/nT0nGC5pzV2S9ERZKc47XWnVaSL Xk7bMKDoKFCjnSTCAqETUEyVMLMqzWw0k9bOLb9dJD08yIes7gkaZVkxR/casmYZRXE4 JaBVexDldMf5kNu308dJ/2s4/ZrFV2xwgXZDAhVuILT5wQ4jgUeLzPP7K6Y1OmqQ9w7p i2KkDiIG/dWbnuKTEf7Jgl8mKXxh1aDz/5kOXLo0S9MNRxBjyXyM/Kmzeaxt6REmTTiT oMMg== X-Gm-Message-State: AOAM533YgF7iBr2QynlMSm/jcJsfGo/DoyPMg0USdzKALGWTvCJmwiVh D+srcn5C64Bfeg3eS7VQqlhC20tXdQ1KRM+CNLYGeZTB X-Google-Smtp-Source: ABdhPJw1hv8xQ+rHIf40X4am7d3BTQZHwnKJo0feHTekT9/Qo0Gpc7Nmh3NytajaOy4ansoHukGLkSeq7Fl+nclZ7+Y= X-Received: by 2002:a25:3252:: with SMTP id y79mr37325761yby.5.1638739147759; Sun, 05 Dec 2021 13:19:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nathan Dehnel Date: Sun, 5 Dec 2021 15:18:56 -0600 Message-ID: Subject: Re: How to put a file in /gnu/store and set its permissions To: Leo Famulari Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::b2b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::b2b; envelope-from=ncdehnel@gmail.com; helo=mail-yb1-xb2b.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-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@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638739188; 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=K0uJET0O1tYljjVXsfkwj3ms95E0bWlvQhRuFgIMoJE=; b=gVA7WSlJziGwkkdyOzijh+WytW2qT7KvXJ8m9qDPJnaxIWwR5HlSPgO4dn6V5Uclm1mH6z 7PjHruAEZAVXuYVFOGG62JNO9dKVmJFHKXnUnd+svgr81epbZcyGwwMJJhv935p3ZpFjka sgbEviFwKqIM/2YtDFzHjfB1SflFMJ8E89luEFvRJZfUlXFIw7vYKIu9D/BZaH9oTjs1Ll 9KtfBvXcEWy0F8QCZTiM7rSSRjQQWmEs4OhfnyYazZgtXV6y7Sv1pzXW5xfrB+OS6+zYrx 3VpKk+t0nO6fi3ZD973t/bY5aOK1qmPep7qAseJK/DIchO27aOug7rGWoFnUEA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638739188; a=rsa-sha256; cv=none; b=Jj/hMiTmshhPG9a9S+0a13+ymf/N65dDCAxKoak35mswTSimJ2VaPiEjkg3638fPTQzLpc X4eZpqUXvxgwlzQDDCB8nmTowGIEKx72eJbm405VKg7juoFrAnukpijUDNTIW9Kh7xLJv9 p+os0MgRfG7mcumoXlVLOME85n1e9yKpGGdhchxz58DWd8wpWlD12Ni6yO3GUZ0EWHJ2h7 eRO4nRi90izb1YJq00su2wtUe3UJZytn7P8nPJ3dI8Do1irfRSoN/DVVEgcCqPdTsHBqfL 7xJ4i70picYJyl4KKf9hE811IYRMM56rWKGeRXDyzIAEAeJQhQRY6TocQstNzQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e6J6V0b6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e6J6V0b6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3CC222FC65 X-Spam-Score: -4.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3BnQ1MxSBOlt Thanks. I guess then I need to know how to put a file in /etc/ssh without putting it in the store. On Sat, Dec 4, 2021 at 11:13 PM Leo Famulari wrote: > > On Sat, Dec 04, 2021 at 04:47:12PM -0600, Nathan Dehnel wrote: > > https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html > > This says to set #:recursive? #t and guix will preserve its > > permissions in the store. I have done this: > > > > (define guixrig_host_rsa_key > > (local-file "ssh/guixrig_host_rsa_key" #:recursive? #t)) > > > > The file this expression puts in the store has permissions of 444, > > despite the original being 400. How do I prevent guix from changing > > permissions, or manually override them? > > In general, the store cannot be used to store secrets. By design, > everything in the store is made world-readable despite what permissions > are set, for example in a package definition. I'm not sure if that's > documented in the manual; I don't see it in the manual section The Store > [1]. > > I'm not sure exactly what code ensures that everything in the store is > readable, but it's probably somewhere in the daemon [0], which is what > writes to the store [1]. > > The question of how to handle secrets in Guix has been discussed many > times over the years and there are some solutions in various services; > maybe there is a canonical solution now. But basically the idea is to > store the secret outside of the store, like in /etc, as defined in a > service configuration in config.scm. > > Hopefully some other people can join the conversation with more specific > advice. > > [0] > https://git.savannah.gnu.org/cgit/guix.git/tree/nix?h=v1.3.0 > > [1] I'd guess that canonicaliseTimestampAndPermissions is always called: > https://guix.gnu.org/manual/en/html_node/The-Store.html