From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id T2l+Jh4vhGBbYQAAgWs5BA (envelope-from ) for ; Sat, 24 Apr 2021 16:45:50 +0200 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 EBAjIR4vhGD8DgAA1q6Kng (envelope-from ) for ; Sat, 24 Apr 2021 14:45:50 +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 13B732362E for ; Sat, 24 Apr 2021 16:45:50 +0200 (CEST) Received: from localhost ([::1]:55638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laJXZ-0002fI-9W for larch@yhetil.org; Sat, 24 Apr 2021 10:45:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laJXN-0002f4-HI for help-guix@gnu.org; Sat, 24 Apr 2021 10:45:37 -0400 Received: from marvid.fr ([163.172.81.107]:48590 helo=courriel.marvid.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laJXL-00055t-3q for help-guix@gnu.org; Sat, 24 Apr 2021 10:45:37 -0400 Received: from localhost (schwifty.marvid.fr [51.159.4.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by sahkopoika (Postfix) with ESMTPSA id 12331511E199; Sat, 24 Apr 2021 16:44:53 +0200 (CEST) References: User-agent: mu4e 1.4.15; emacs 27.2 From: Sergiu Ivanov To: phodina Subject: Re: Installing file outside package in /etc In-reply-to: Date: Sat, 24 Apr 2021 16:44:52 +0200 Message-ID: <87r1izvj17.fsf@colimite.fr> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=163.172.81.107; envelope-from=sivanov@colimite.fr; helo=courriel.marvid.fr X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, FORGED_SPF_HELO=1, SPF_HELO_PASS=-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.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619275550; 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; bh=UsBbvpJdd8jDXznmCQWAVAhFz4ihLU6BAkZsq1Pi67Q=; b=WgR+Z7uyP5vU+vQNaSYvhp+negt9C+4IX189gbbntqqN6Tjheruiwtm8J4ceiCtAlkb1so BAWD2/YUd/4QAAXSNFnxsUM5nmlbeWcHfezJ11tjxUXi+ImzhLD/NFYE2sJ6tI0xno7Riu o9GCYoVlWnfTSIXRnD0lGS0vyRZ994wg7spaMSdb3ymVjGqx31YcXidCFWwUuI99AGo2/9 pPyyN++rxzsAgWddxLeVud/Xr822bm9r2zf/a5bEcU6mwUfv6HF+rqfMBmICm/MaDDgbw/ G2P0jDzrqxRpI9J3i7YZbNHJiITcleHjValLMHtaGMH0JP5Oy1FfL7V1a1sUeA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619275550; a=rsa-sha256; cv=none; b=qeWoGzPbQNrHn+Ii9Hp64KpCf6R91OxDCIpp6w1xOlshsVRUraPCytcVloklJp0MtEjh1q ATT40FmWEm80xyuNwBhP54kIDnJnM1isWj05PmiPqHXlGCulgaakSGihjulrvvhZJZTUK0 Z5CV+fAmDQLw/SgNXbOxoiszOss5W/ZtSp5hxoJOXOUdsH4YBM4K0hoUf7Ug2esh508g3w l7wc/funeh+XaXzWsi80e61x8e0tR2AB3e1BQJLz1x0PNbcdxMztxurRtDMIOkdvOJkcAQ KYlEOelLswekkVrnazmtYb6tb2qq1bzjWnOpyz61F+UP3WxMok9gkDh5lzXeQg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: 13B732362E X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: sC66MKCqiuiV Hi, Guix beginner here. Thus quoth phodina via on Sat Apr 24 2021 at 11:30 (+0200): > I'm creating a package for application which needs to install file > outside of the derivation directory. > > The file in question is /etc/sudoers.d but it can be generalized for > other things like udev etc. I understand this won't be trivial since > it modifies the system and will probably require some wrapper with > higher privileges. However, I could not find any section in the Guix > reference Manual. > > The file is installed in the install phase. Is it the right phase or > shall I use different? If so how do I patch it? >From what I understand of Guix/Nix, you would have to modify the definition of your operating-system (in /etc/config.scm) to install a file under /etc/, which is clearly not what you are trying to achieve. I have the impression that modifying files outside the output directory is out of the scope of Guix/Nix packages, which is probably why the Guix manual doesn't even speak about that problem. Maybe some more experienced people have better advice. > Also if I compare the contents of GuixSD to NixOS, then the NixOS has > more files linked to /etc/static/ which then links to > /nix/store. Could somebody please explain what were/are the thoughts > behind this? I checked /etc/static on two machines, one running Guix System and the other one NixOS, and it looks to me that those symlinks contain the static (duh) parts of the configurations, which are generated from the corresponding operating system definitions. These files are put into the store and are not supposed to be changed other than by changing the definitions of the operating system. I have the impression that Nix links every single static file to a file in the store, while Guix only links directories. For example, on my Guix System, /etc/hostname is a normal file, while on NixOS it is a symlink to /etc/static/hostname. This should explain the difference in the number of symlinks. Note however that /etc/hostname appearing to be a normal file may be misleading, since it may also be a hardlink to a file in the store. It is beyond my knowledge/motivation to figure out whether it really is or not :-) - Sergiu