Re: Guix as a package manager for Emacs

2020-01-28 Thread EuAndreh via
zimoun  writes:

> Maybe you can give a try to Guix Home Manager. :-)
>
> https://framagit.org/tyreunom/guix-home-manager

H, that looks interesting!

I'll take a look at it, thanks for the link :)


signature.asc
Description: PGP signature


Re: Guix as a package manager for Emacs

2020-01-28 Thread EuAndreh via
zimoun  writes:

> 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.
> :-)

At first I though guix would install the packages, but Emacs would be
unable to look them up on the store. I didn't realize the final profile
would setup Emacs to correctly look them up.

So I was missing an 'emacsWithPackage' tool that would do that binding,
but it doesn't actually seem necessary.

Using a manifest seems a good solution, I'll try it out.

Thanks for the code snippet too. Hopefull I'll get it working and
write/blog about it.

:)


signature.asc
Description: PGP signature


Re: Guix as a package manager for Emacs

2020-01-28 Thread EuAndreh via
zimoun  writes:

> The formatting failed! :-(
>
> I let you use Emacs to reformat correctly. :-)

Challenge accepted!


signature.asc
Description: PGP signature


Re: Guix as a package manager for Emacs

2020-01-23 Thread zimoun
On Wed, 22 Jan 2020 at 16:11, John Soo  wrote:

> Has anyone used the portable dumper yet? Could it be used to make a custom 
> emacs package with the specified emacs packages dumped to a separate dump 
> file?

Interesting idea. :-)


> Just some thoughts I’ve had and tried recently but I don’t really know where 
> the dumper is at these days.

Do not know neither. I have understood reading emacs-devel that the
plan was to release it with 27. Who knows... ;-)


All the best,
simon



Re: Guix as a package manager for Emacs

2020-01-23 Thread zimoun
Hi,

On Wed, 22 Jan 2020 at 05:10, EuAndreh via  wrote:

> 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.

[...]

> How can I accomplish it with Guix?

Maybe you can give a try to Guix Home Manager. :-)

https://framagit.org/tyreunom/guix-home-manager


All the best,
simon



Re: Guix as a package manager for Emacs

2020-01-22 Thread John Soo
Hi everyone,

Has anyone used the portable dumper yet? Could it be used to make a custom 
emacs package with the specified emacs packages dumped to a separate dump file?

Just some thoughts I’ve had and tried recently but I don’t really know where 
the dumper is at these days.

John


Re: Guix as a package manager for Emacs

2020-01-22 Thread zimoun
Ah crap!

On Wed, 22 Jan 2020 at 15:14, zimoun  wrote:

> --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"

The formatting failed! :-(

I let you use Emacs to reformat correctly. :-)

> 

[...]
> --8<---cut here---end--->8---



Re: Guix as a package manager for Emacs

2020-01-22 Thread zimoun
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
   e

Re: Guix as a package manager for Emacs

2020-01-22 Thread EuAndreh via
Pierre Neidhardt  writes:

> Hi!

Hello :)

> I'm not sure this is the answer you are looking for, but with Guix you
> can simply install the desired "emacs-*" packages.

So if I were to add the 'emacs' and 'emacs-evil-collection' packages, I
could just require the packages? I'll try this next and report back if I
encounter any problem.

I actually considered this possibility, but ruled this out because it
sounded too simple xD.



Re: Guix as a package manager for Emacs

2020-01-22 Thread Pierre Neidhardt
Hi!

I'm not sure this is the answer you are looking for, but with Guix you
can simply install the desired "emacs-*" packages.

Should you install them to a non default profile, make sure you source
the relevant etc/profile or export EMACSLOADPATH to

$GUIX_PROFILE/share/emacs/26.3/lisp

(Replace 26.3 with your Emacs version.)

Once this is done, you should be able to call

  (require ...)

from your Emacs initialization file, or

  M-x load-library

interactively.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Guix as a package manager for Emacs

2020-01-21 Thread EuAndreh via
Hi Guix!

How can I get in Guix something similar to Nix's emacsWithPackages:
https://nixos.org/nixpkgs/manual/#sec-emacs-config

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.

I found some previous messages and discussions in the lists archives,
but couldn't find guidance on how to proceed.

How can I accomplish it with Guix?

Thanks :)