Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builtin packages in use-package #6

Closed
peel opened this issue Sep 4, 2019 · 6 comments
Closed

builtin packages in use-package #6

peel opened this issue Sep 4, 2019 · 6 comments

Comments

@peel
Copy link

peel commented Sep 4, 2019

use-package allows for bundling together package-related configuration, which allows for cleaner, more effective init.
Example:

(use-package dired
  :ensure nil
  :config
  (setq dired-dwim-target t
        dired-recursive-deletes t
        dired-use-ls-dired nil
        delete-by-moving-to-trash t))

Currently it is not possible to use the kind of approach with the overlay.
elisp.nix searches matched packages in the package set, but as they are builtin they are not in the set. I made a quick workaround but haven't gotten around to make it clean and PR-ready.

Thank you for the great work!

@adisbladis
Copy link
Member

I've also noticed this problem but wasn't sure of what solution to go for.

I was considering simply making failed use-package lookups return null as that would require zero maintenance going forward.
What do you think of this?

@peel
Copy link
Author

peel commented Sep 4, 2019

Definitely makes sense and that's the least maintenance-burden 👍

Though having a xxxx attribute missing was helpful when diagnosing the problem.
With the null yielded for both truly missing and builtin packages we'd lose the kind of safety net.

@marzipankaiser
Copy link

For this and #8, the clean solution for me would seem to be parsing use-package's :ensure arguments, this could then be used to prevent package.el from running.
That way, existing configs should kind of "just work" and special packages (e.g. where the package name is different for use-package and nixpkgs) can be handled in a readable way.
This would, however, mean writing a much more complicated parser.
I currently do not have the time to implement this, and I'm happy with other solutions, but I saw this in the use-package docs and thought I'd share the idea.

@alexvorobiev
Copy link

Would creating an alias for use-package so that the parser in the overlay wouldn't find it, e.g.

(defalias 'use-local-package 'use-package)

be another workaround? Then use this alias for local packages.

@adisbladis
Copy link
Member

@alexvorobiev That would work but feels hacky. I want the experience of adopting Nix for emacs configuration management to be as smooth as possible
You should be able to take your configuration unmodified and pass it to fromEmacsUsePackage.

@adisbladis
Copy link
Member

Closed by merging #43.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants