Skip to content

Code-Maniac/dotbot-omnipkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

dotbot-omnipkg

Plugin for dotbot to streamline package management, installs packages with the system package manager on Linux or brew if on OSX.
Currently supports:

  • dnf
  • apt-get
  • pacman
  • brew

Installation

Just add it as a submodule of your dotfiles repository

git submodule add https://github.com/code-maniac/dotbot-omnipkg

Modify install script so that it automatically enables dotbot-omnipkg plugin

BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OMNIPKGPLUGIN="${BASEDIR}/dotbot-omnipkg/omnipkg.py"

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
    -d "${BASEDIR}" \
    -c "${CONFIG}" \
    -p "${OMNIPKGPLUGIN}" \
    "${@}" 

Usage

The following directives are supported:

  • update
  • install
  • upgrade

Each being placed under the main "omnipkg" directive

Update package lists for the installed package manager:

- omnipkg:
    - update

Update currently installed packages:

- omnipkg:
    - upgrade

Install the packages in the list

- omnipkg:
    - install: [
        kitty,
        tmux,
        zsh,
        neovim]

Install single package from the list:

- omnipkg:
    - install: [
        [ python3, python ]
      ]

Priority is given to first package in the list.
To be used when a package has a different name depending on the distro that it's being installed on. In the above example python3 is named python3 on OSX and Ubuntu but is named python on Arch.

Filter installation of packages by package manager and platform

- omnipkg:
    - install: [
        { dnf: https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm },
    ]

Above installs rpmfusion free repos if dnf is the package manager otherwise is ignored

- omnipkg:
    - install: [
        { linux: g++ }
    ]

Above installs g++ on linux but is ignored on mac

The following filters are supported:

  • dnf - for dnf package manager
  • pac - for pacman package manager
  • apt - for apt-get package manager
  • brew - for brew package manager
  • linux - for linux platform
  • mac - for mac platform
  • else - for any not specified

Priority is given to package manager first, then platform, then else

Additionally packages can be restricted to only install on systems with an installed gui.

- omnipkg:
    - install: [
        { linux: gimp, require_gui: true }
    ]

Above installs gimp only on a system with an installed gui. It will not install in WSL or a docker image as an example.

Roadmap

  1. Add directive to support adding new PPA repositories
  2. Add support for additional package managers - zypp, emerge etc

License

MIT