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 GBneMVYW21/6dwAA0tVLHw (envelope-from ) for ; Thu, 17 Dec 2020 08:27:02 +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 WL62LVYW21/wdgAAB5/wlQ (envelope-from ) for ; Thu, 17 Dec 2020 08:27:02 +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 880D1940481 for ; Thu, 17 Dec 2020 08:27:02 +0000 (UTC) Received: from localhost ([::1]:35596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpocn-0005Uk-Aq for larch@yhetil.org; Thu, 17 Dec 2020 03:27:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpoca-0005Ub-UA for guix-devel@gnu.org; Thu, 17 Dec 2020 03:26:48 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:38173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpocZ-0007BL-BE for guix-devel@gnu.org; Thu, 17 Dec 2020 03:26:48 -0500 Received: by mail-wm1-x32e.google.com with SMTP id g185so4883372wmf.3 for ; Thu, 17 Dec 2020 00:26:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=W+RstXfrnbW/hrmWM2DDsk2QgMiyC5XJh3Da5POLZhM=; b=lsRncHWpN3TLWOESa40+7ZNJuT+38UkOx/Ud7VyQhvoATjuT6dIfYGKfdUTqWcDNtX J4hmzpgLRQeDWMTsbrY7vtfq0czKQkdyDW4QamrLfHXBSe8BjonOo7a9bxhRMJMVNrky eUqRVR1BKXpWtZdmBsZR9nkQdgXgOiqVNaB8SJ/Ku9UR1rofJ7bGgS7nQ7vylpd0sUE4 0tv1AUn5s2ggaGr/A2O1NEqBxi3yIh3uM0mBScQLZJnsWdigRg5iVRBvFxtyEwUiF32/ OlvVyChOmfppE70VgKs7MewLJ2sheDajOJVt3I5MxZRNOrVB37CPNMcmoHqJVwkOeEY0 vqNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=W+RstXfrnbW/hrmWM2DDsk2QgMiyC5XJh3Da5POLZhM=; b=Bi6uQdtFyW1VMgtirbZkmy35UbX0J2s7YBe9EtLLnrko67ZVPPqsmrJAIgNiriIrpC V+spGtyx3Ko7HYBhobWt5LlI46sohoWS2T5FnDo08W2FjJHyTbVWNrsrojr70qvAZjDE Q929ajmiTtdzWq9Ef68CoM9MuliAgG9V0RyQNiDN+oqPej2RBUofctJOQDushWcmB2wi LjD76AmE9wkMfjngvRoic+YMqL9pMCoLZeRIa17O3k8LMq0hKtLoLvJNd7HEIDLCljQ8 2mjjh+2XzZoceaf+t+syAQA4M/xPxYGkwEg+Fhl8yTiiNjvpcSTDWXqZIgQk3FpfpI+a 5Szw== X-Gm-Message-State: AOAM532VS8pIehldp7YolxNrfuDaWG4KNHmvJD2ySaZx1uOE0N8g6Anl cybvriucDbL2wJFJBU/23Og7gqoezZg= X-Google-Smtp-Source: ABdhPJy2BJGDR7FE9EO6oK1m0V+1CnSF5ocUu7OxOe5GbndfTsVrlxZtC7C5V5b1LA4XaVZsGnSi0w== X-Received: by 2002:a1c:bc41:: with SMTP id m62mr7411781wmf.46.1608193605832; Thu, 17 Dec 2020 00:26:45 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id g191sm7015345wmg.39.2020.12.17.00.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 00:26:45 -0800 (PST) From: zimoun To: pinoaffe , guix-devel@gnu.org Subject: Re: Some emacs stuff to activate/deactivate guix profiles In-Reply-To: <877dphyqn2.fsf@gmail.com> References: <877dphyqn2.fsf@gmail.com> Date: Thu, 17 Dec 2020 09:26:11 +0100 Message-ID: <86h7okon30.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32e.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.51 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=lsRncHWp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 880D1940481 X-Spam-Score: -1.51 X-Migadu-Scanner: scn0.migadu.com X-TUID: W+JE12G2z40K Hi, On Thu, 17 Dec 2020 at 05:59, pinoaffe wrote: > I've attached the reusable stuff in guix-profiles.el, and my personal > config in init-profiles.el. Thanks for sharing. > (defun guix-profiles->environment-vars (profiles) > (shell-command-to-string > (string-join (apply #'list > "guix" > "package" > "--search-paths" Instead of call shell command and then=E2=80=A6 > (defun guix-path-file->key-value (str) > (mapcar (lambda (line) > (let* ((lst (split-string line "=3D")) > (var (string-remove-prefix "export " (car lst))) > (val (string-trim (string-join (cdr lst) "=3D") "\""= "\""))) > (cons var val))) > (split-string (string-trim-right str "\n") > "\n"))) =E2=80=A6parse the output, you should give a look at how Emacs-Guix does us= ing the Scheme API. Or maybe use =E2=80=9Cguix repl=E2=80=9D as Nyxt does. Aside, it is a bit redundant with Emacs-Guix, from my understanding. :-) All the best, simon