emacs-twist / twist.nix

Build an entire Emacs configuration as a Nix package in a pure, reproducible way
GNU General Public License v3.0
66 stars 6 forks source link

Add a minimal API for checking masked built-in libraries #115

Closed akirak closed 1 year ago

akirak commented 1 year ago

Regarding #113, this is a minimal API for finding packages that are available as built-in libraries.

Usage:

nix eval .#emacs.maskedBuiltins [--raw|--json]

It prints a list of package names. Unless you have a specific reason to explicitly install them, you can remove :ensure t from use-package declarations (if you are using use-package) for those packages to prefer the built-in versions of the libraries.

@terlar You can use this to solve the problem you mentioned in https://github.com/emacs-twist/twist.nix/issues/112#issuecomment-1516040004:

I should probably go through my list of packages to exclude any other packages that might be bundled with Emacs nowadays.

terlar commented 1 year ago

Thank you :)

Seems to be working:

$ nix eval --json .#emacsEnv.maskedBuiltins                                                                                                                          
["python"]

Interestingly enough, python package never got added to my lock files:

$ rg python lock/
lock/flake.nix
1102:    python-test = {
1105:      repo = "python-test.el";

lock/flake.lock
2947:    "python-test": {
2953:        "repo": "python-test.el",
2959:        "repo": "python-test.el",
3405:        "python-test": "python-test",
akirak commented 1 year ago

Interestingly enough, python package never got added to my lock files:

That's because python is a core package and built from the Emacs source (which you specified in core-src).

akirak commented 1 year ago

@terlar You can confirm that python is built from the Emacs source using the following command:

nix eval .#emacsEnv.packageInputs.python.src.meta --json

It prints the same version information as GNU Emacs you specified in core-src.