Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

jabranham/system-packages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System Packages

This is a collection of functions to make handling installed system packages more convenient through emacs.

Installation

System packages is available on MELPA. If you use use-package and have MELPA set up correctly, all you’ll need is something like the following:

(use-package system-packages
  :ensure t)

Configuration

The package attempts to guess which package manager you use. If it guesses wrong (or you’d like to set it manually), you may modify the variable system-packages-package-manager.

We also attempt to guess whether or not to use sudo with appropriate commands (like installing and uninstalling packages). Some package managers (like homebrew) warn not to use sudo, others (like apt) need sudo privileges. You may set this manually by configuring system-packages-use-sudo.

Other package customization options can be accessed with M-x customize-group RET system-packages RET.

Supported package managers

Currently, system-packages knows about the following package managers. You can see exactly what commands are associated with system-packages commands by checking system-packages-supported-package-managers. The default package manager that we use is the first one found from this list:

  • guix
  • nix
  • brew
  • macports
  • pacman
  • apt
  • aptitude
  • emerge
  • zypper
  • dnf
  • xbps

Usage

The package doesn’t presume to set keybindings for you, so you may set those up yourself or simply call functions with M-x. All commands start with system-packages

Adding other package managers

It is straightforward to add support for package managers. First, add the commands to system-packages-supported-package-managers like so:

(add-to-list 'system-packages-supported-package-managers
             '(pacaur .
                      ((default-sudo . nil)
                       (install . "pacaur -S")
                       (search . "pacaur -Ss")
                       (uninstall . "pacaur -Rs")
                       (update . "pacaur -Syu")
                       (clean-cache . "pacaur -Sc")
                       (log . "cat /var/log/pacman.log")
                       (get-info . "pacaur -Qi")
                       (get-info-remote . "pacaur -Si")
                       (list-files-provided-by . "pacaur -Ql")
                       (verify-all-packages . "pacaur -Qkk")
                       (verify-all-dependencies . "pacaur -Dk")
                       (remove-orphaned . "pacaur -Rns $(pacman -Qtdq)")
                       (list-installed-packages . "pacaur -Qe")
                       (list-installed-packages-all . "pacaur -Q")
                       (list-dependencies-of . "pacaur -Qi")
                       (noconfirm . "--noconfirm"))))

You may then need to adjust system-packages-package-manager and system-packages-use-sudo accordingly:

(setq system-packages-use-sudo t)
(setq system-packages-package-manager 'pacaur)

See also

Helm users might like helm-system-packages