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

README: clarify extraEmacsPackages usage #452

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

acid-bong
Copy link
Contributor

@acid-bong acid-bong commented Dec 12, 2024

Inspired by mu4e's recipe

Now here's a lil issue i'd love to resolve:

  • if you nix build|run such a closure, extraPackages won't be available
  • only when this closure is installed (with nix profile install or adding it to environment.systemPackages/home.packages), extraPackages can be propagated.*

Is this behaviour fine as is or should I make extraPackages always available?

*Just tried with nixos-rebuild test, somehow this doesn't work 🤔

@talyz
Copy link
Contributor

talyz commented Dec 12, 2024

Another issue is that this only works when defaultInitFile is used, which it isn't by default.

Copy link
Member

@jian-lin jian-lin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am strongly against using propagatedUserEnvPkgs here. The reasons are as follows:

  • propagatedUserEnvPkgs has issues. See links in [documentation] There is no documentation for propagatedUserEnvPkgs NixOS/nixpkgs#347093.
  • Here, we use emacsWithPackages which will add bin dirs of packages in extraEmacsPackages to exec-path. To find executables, Emacs lisp packages should respect exec-path by using functions like executable-find. If one Emacs lisp package do not respect exec-path, that package itself should be fixed.
  • I use propagatedUserEnvPkgs in the mu4e package only to support unrecommended use cases where emacsWithPackages is not used. For example, users install Emacs lisp packages by adding them to environment.systemPackages.

@acid-bong
Copy link
Contributor Author

acid-bong commented Dec 13, 2024

Ight, I'm limiting this edit only to README, where i clarify that one can just use extraEmacsPackages or .withPackages. Or, better, just rename the former

@acid-bong acid-bong marked this pull request as ready for review December 13, 2024 17:37
@acid-bong acid-bong requested a review from jian-lin December 13, 2024 17:38
@acid-bong acid-bong changed the title emacsWithPackagesFromUsePackage: support adding extra programs rename extraEmacsPackages to extraPackages, update README Dec 13, 2024
@acid-bong acid-bong changed the title rename extraEmacsPackages to extraPackages, update README README: clarify extraEmacsPackages usage Dec 13, 2024
Copy link
Member

@jian-lin jian-lin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@jian-lin jian-lin merged commit 7b68c5b into nix-community:master Dec 14, 2024
1 check passed
c4710n added a commit to nix-giant/nix-darwin-emacs that referenced this pull request Dec 24, 2024
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

Successfully merging this pull request may close these issues.

3 participants