From mboxrd@z Thu Jan 1 00:00:00 1970 From: zimoun Subject: Re: Guix as a package manager for Emacs Date: Wed, 22 Jan 2020 15:14:26 +0100 Message-ID: References: <87pnfcf7y5.fsf@euandre.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57828) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuGmG-00072V-Ni for Help-Guix@gnu.org; Wed, 22 Jan 2020 09:14:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuGmF-0002yV-Bd for Help-Guix@gnu.org; Wed, 22 Jan 2020 09:14:40 -0500 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:35279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuGmF-0002y1-7Y for Help-Guix@gnu.org; Wed, 22 Jan 2020 09:14:39 -0500 Received: by mail-qt1-x82b.google.com with SMTP id e12so5718847qto.2 for ; Wed, 22 Jan 2020 06:14:38 -0800 (PST) In-Reply-To: <87pnfcf7y5.fsf@euandre.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: EuAndreh Cc: help-guix Hi, On Wed, 22 Jan 2020 at 05:10, EuAndreh via wrote: > How can I get in Guix something similar to Nix's emacsWithPackages: > https://nixos.org/nixpkgs/manual/#sec-emacs-config I do not understand what Nix does. Namely, from where do the packages come from? Nix or ELPA? > It shows how to use Nix's packaging capabilities to setup and configure > Emacs, instead of having "use-package" (or similar tools) downloading > and installing packages. The easiest way to achieve similar is to use a manifest file, IMHO. Let consider the file below named '/tmp/my-emacs-config.scm', then it is easy to create a profile (or environment): guix package -m /tmp/my-emacs-config.scm -p /tmp/my-profile and the Emacs living in this very profile should be correctly setup-ed for your needs. Therefore let source the profile or whatever and done. :-) Be careful, a manifest file must return a manifest, so the order matters. However, the file '~/.emacs' is not "protected" and you can add some Scheme code to change it as read-only. Another less straightfoward path is to write our own package definition. But with the current situation -- about partially rewriting on-the-fly the 'arguments' field -- it will be a bit harder. Hope that helps. simon --8<---------------cut here---------------start------------->8--- (use-package-modules emacs emacs-xyz) (with-output-to-file (string-append (getenv "HOME") "/.emacs") (lambda () (display (string-append ";; initialize package \n" " \n" "(require 'package) \n" "(package-initialize 'noactivate) \n" "(eval-when-compile \n" " (require 'use-package)) \n" " \n" ";; load some packages \n" " \n" "(use-package company \n" " :bind (\"\" . company-complete) \n" " :diminish company-mode \n" " :commands (company-mode global-company-mode) \n" " :defer 1 \n" " :config \n" " (global-company-mode)) \n" " \n" "(use-package counsel \n" " :commands (counsel-descbinds) \n" " :bind (([remap execute-extended-command] . counsel-M-x) \n" " (\"C-x C-f\" . counsel-find-file) \n" " (\"C-c g\" . counsel-git) \n" " (\"C-c j\" . counsel-git-grep) \n" " (\"C-c k\" . counsel-ag) \n" " (\"C-x l\" . counsel-locate) \n" " (\"M-y\" . counsel-yank-pop))) \n" " \n" "(use-package flycheck \n" " :defer 2 \n" " :config (global-flycheck-mode)) \n" " \n" "(use-package ivy \n" " :defer 1 \n" " :bind ((\"C-c C-r\" . ivy-resume) \n" " (\"C-x C-b\" . ivy-switch-buffer) \n" " :map ivy-minibuffer-map \n" " (\"C-j\" . ivy-call)) \n" " :diminish ivy-mode \n" " :commands ivy-mode \n" " :config \n" " (ivy-mode 1)) \n" " \n" "(use-package magit \n" " :defer \n" " :if (executable-find \"git\") \n" " :bind ((\"C-x g\" . magit-status) \n" " (\"C-x G\" . magit-dispatch-popup)) \n" " :init \n" " (setq magit-completing-read-function 'ivy-completing-read)) \n" " \n" "(use-package projectile \n" " :commands projectile-mode \n" " :bind-keymap (\"C-c p\" . projectile-command-map) \n" " :defer 5 \n" " :config \n" " (projectile-global-mode)) \n")))) (packages->manifest (list emacs emacs-company emacs-ivy emacs-flycheck emacs-ivy emacs-magit emacs-projectile emacs-use-package)) --8<---------------cut here---------------end--------------->8---