From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Johnson Subject: Re: Scripting guix in guile (Konrad Hinsen) Date: Fri, 06 Sep 2019 16:56:29 -0400 Message-ID: <87ef0t87pe.fsf@gmail.com> References: <87sgpa1cu1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35984) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6LHp-0004Mn-5u for help-guix@gnu.org; Fri, 06 Sep 2019 16:56:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6LHm-0004ib-Ll for help-guix@gnu.org; Fri, 06 Sep 2019 16:56:52 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:44807) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6LHl-0004eM-Cv for help-guix@gnu.org; Fri, 06 Sep 2019 16:56:49 -0400 Received: by mail-pf1-x435.google.com with SMTP id q21so5368051pfn.11 for ; Fri, 06 Sep 2019 13:56:46 -0700 (PDT) In-reply-to: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Konrad Hinsen Cc: help-guix@gnu.org Hi Konrad, Fair enough. I was pleasantly surprised to discover that trick while digging through the Guix manual several months ago. In the Guix info pages, the documentation for it can be found under this path: System Configuration -> Services -> Base Services -> extra-special-file I'm not one of the Guix developers. I'm just a user, but my guess as to why it isn't defined by default is that a big part of the GuixSD mindset/philosophy AFAICT is to ensure that as little as possible is installed under the usual FHS file tree (e.g., /usr, /bin, /sbin, /etc, ...). Instead as much of the OS as is technically feasible is installed under /gnu/store. This makes reproducing the same OS setup on a different machine a matter of just running a handful of Guix commands on a blank hard drive partition and feeding them your operating-system definition and package manifest (both encoded as Scheme objects, of course). It also reduces the likelihood of any file collisions when using the Guix package manager on a foreign distro. Since you're teaching a tutorial on Guix, you no doubt already grok all of this, so my apologies for any redundancy here. In short, I just guess /usr/bin/env isn't there because it doesn't need to be there for most day-to-day Guix usage. If it is useful to a user, they can add the extra-special-file service to their operating-system definition as per my example. That being said, if /usr/bin/env were added by default to the special-files-service-type (which is part of %base-services), I'd certainly not complain, and I think it would save quite a few users the time that I spent digging through the manual for that particular solution. Good luck and happy hacking! Gary Konrad Hinsen writes: > Hi Gary, > >> Just in case you hadn't thought of this yet, you can ensure that >> /usr/bin/env exists on any Guix system by consing the following entry >> onto the list of services under your operating-system definition. > > I hadn't thought of this for the simple reason that I didn't know about > this mechanism. It looks very useful, thanks for the pointer! > > Is there any reason why this isn't defined by default? That would solve > portability problems for lots of scripts, and I don't see any > disadvantage caused by this link. > > Cheers, > Konrad