use-package
use-package copied to clipboard
Conditional package pinning, loading, etc.
Is it possible to conditionally pin and demand package? For example,
- If OS is windows, then demand package
- If OS is windows, then pin package to melpa-stable
I think I can do this outside of use-package, but I'm wondering if there is an idiomatic solution.
Thanks. John
I think the following kind of gets you what you want. Package foo will only be loaded and initialised on Windows. It will be installed on other systems though but just not loaded. Is that acceptable?
(use-package foo
:if (eq system-type 'windows-nt)
:ensure t
:pin melpa-stable)