Code Monkey home page Code Monkey logo

dotbot-omnipkg's Introduction

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

dotbot-omnipkg's People

Contributors

code-maniac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dotbot-omnipkg's Issues

dnf check-update exit code 100

The sudo dnf check-update command returns an exit code of 100 when there are updates available. This result causes Error executing update subdirective and an unexpected interruption.

Seems like UpdateCommand is only useful to apt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.