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 ms11 with LMTPS id CLxXNMv83F5veQAA0tVLHw (envelope-from ) for ; Sun, 07 Jun 2020 14:42:19 +0000 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 wBc5MMv83F42RAAAB5/wlQ (envelope-from ) for ; Sun, 07 Jun 2020 14:42:19 +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 3CDBC94066A for ; Sun, 7 Jun 2020 14:42:19 +0000 (UTC) Received: from localhost ([::1]:32924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhwV7-0006yH-Os for larch@yhetil.org; Sun, 07 Jun 2020 10:42:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhwV0-0006y9-Vf for help-guix@gnu.org; Sun, 07 Jun 2020 10:42:11 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:45983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhwV0-0007NY-5J for help-guix@gnu.org; Sun, 07 Jun 2020 10:42:10 -0400 Received: by mail-qt1-x841.google.com with SMTP id y1so12666348qtv.12 for ; Sun, 07 Jun 2020 07:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XiGWpBHl4uwpTOX+uWHWBC/EeJKYShy3h2d6Qbxrv3o=; b=eBqzxdDtNa3o9Z9nxqsOTKMvMiTR2TcnIjzBYY7MunwglYiUMWVwMwqdVGAI4geVtd p3+aKsSgtoOwJlyGIqZ1HS8D6MNmCsK+9PKloxucgnCA/xZ9BHldraxwO2CNWyZtL6tD Oyi0oX0872ZKMQdDrglKxqy1AnlycZDZemcX71T7wwl1FAke0qQRC4Sfy3xxj5vX+kqT EfVtpOzQyqFZVbmFPlSFj6EmlQsebBIfSjZePoN/AN1+ttC9+PJ4G27avOmoij3KJqj8 VziL4xVYuiT3EckH+9Kem+EeAtUJgP76nK6pZY5ELH7kf5wpwuUysxslH+NeDpstaaLb OICw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XiGWpBHl4uwpTOX+uWHWBC/EeJKYShy3h2d6Qbxrv3o=; b=d3yMJ90hzFCD6gHyd1mK+XgphScv426ymMXbHbez47iDapfXKiYx8JIumDisDWcf8s KJkiZOZrGHth4IU/N8s7sit0TUKcxXrKavLVGaE8L9PbzToLvmzTaGhOUm0oz8veVePX WHOW3SIAmpfPRfflo6SXTaM5w62PsqfW1NErhJjEBdq2YLfogekPFQ3Q7fhF1t3vmdkT lKcCqHezx1N4uneTep+Rm25V/19obQSqnABIRmL3i0rnMX3W/8tcIkNcsyPjzP7LeFTT MukLSdvPPyzxjWhr41hI3GoZEbwJXmhsErElb4IgOPdFAr8vc7sVSQ0iok+R/hOjiHwm TfMw== X-Gm-Message-State: AOAM531supOdmiShLlobXjfen4/4k0oSQDGSojeyCPKYjDFWBxHnGEyD Xr/U7PswVw8Bv2aNFq4rsAUq9zpEbfNMEhP0eqg= X-Google-Smtp-Source: ABdhPJznhkgKMNx2hDc9PN3UrmagpJRRfC3ZM1uIGUMnopS6AQM8x/ImCant8m9cVnFHH2JIepRC6hf0Umaawv3txvM= X-Received: by 2002:ac8:7092:: with SMTP id y18mr19814446qto.354.1591540929072; Sun, 07 Jun 2020 07:42:09 -0700 (PDT) MIME-Version: 1.0 References: <00896e50-8030-c1ae-be42-6cb5128ff6e7@posteo.de> <3A6D6672-6B43-4EF5-9F5F-AE89F20F5A2C@lepiller.eu> <76a84e1c-798b-eaf0-725f-a6fea5bd76bf@posteo.de> In-Reply-To: <76a84e1c-798b-eaf0-725f-a6fea5bd76bf@posteo.de> From: zimoun Date: Sun, 7 Jun 2020 16:41:57 +0200 Message-ID: Subject: Re: Creating environments using Guix package manager To: Zelphir Kaltstahl Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=zimon.toutoune@gmail.com; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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 Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=eBqzxdDt; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: 0.09 X-TUID: 6xuYdUEAy2nc Dear Zelphir, Well "guix environment" is a piece so the answer depends on which part do you currently use? If you use the "--container" option, then profiles cannot be a drop-in replacement of your current workflow. Or I miss something. However, from your specifications, the combination of manifest files and profiles seems the correct approach for you. For example -- I am running Guix on the top of Debian -- I create the folder '~/.config/guix/manifests' which contains the manifest file named 'default.scm': --8<---------------cut here---------------start------------->8--- (specifications->manifest '("glibc-locales" "nss-certs" "recutils")) --8<---------------cut here---------------end--------------->8--- then I run "guix package -m ~/.config/guix/manifests/default.scm". Well, in this folder I have another manifest file named 'emacs.scm' which contains: --8<---------------cut here---------------start------------->8--- (specifications->manifest '("aspell" "aspell-dict-en" "notmuch" "emacs" "emacs-magit")) --8<---------------cut here---------------end--------------->8--- then I run "guix package -m ~/.config/guix/manifests/emacs.scm -p ~/.config/guix/profiles/emacs". And in my ~/.barsh_profile, I have something looping over these profiles as explained in the blog post. These are my personal setup profiles -- the list of packages is cutted. :-) Then, I have profiles per project which live inside the project folder. For example, I have the folder '~/src/project-foo' which contains a manifest file used to generated the profile, i.e., guix package -m ~/src/project-foo/manifest.scm -p ~/src/project-foo/profile/profile well, I double profile/profile to avoid to pollute the project folder by links; anyway. When I am working on this project, I use "eval $(guix package --search-paths=exact -p ~/src/project-foo/profile/profile)" to set up; 'exact' is sometimes replaced by 'prefix' in my case, well it depends. I do not know if it is what you need. Neither if it is the correct way to organize. Last, it is not easy to have the equivalent of "guix environment hello" using manifest. To do so, you need some undocumented magic. :-) --8<---------------cut here---------------start------------->8--- ;; From HERE (use-modules (ice-9 match) (srfi srfi-1) (guix packages) (guix profiles)) (define (input->manifest-entry input) "Return a manifest entry for INPUT, or #f if INPUT does not correspond to a package." (match input ((_ (? package? package)) (package->manifest-entry package)) ((_ (? package? package) output) (package->manifest-entry package output)) (_ #f))) (define (inputs-of package) (filter-map input->manifest-entry (bag-transitive-inputs (package->bag package)))) ;; To THERE should be replaced by only ;; ;; THAT ;; (define inputs-of (@@ (guix scripts environment) ;; package-environment-inputs)) (make-manifest (inputs-of (specification->package "hello"))) --8<---------------cut here---------------end--------------->8--- then let run guix package -m manif.scm -p /tmp/hello eval $(guix package --search-paths=exact -p /tmp/hello) which is equivalent to "guix environment --pure hello" but in a permanent way. Hope that helps. All the best, simon ps: I do not understand why the '@@' does not work so it is an ugly copy/paste. :-)