Coder Social home page Coder Social logo

opekope2 / opellets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dpatti/pellets

0.0 0.0 0.0 39 KB

A declarative pacman wrapper for Arch Linux to manage installed packages with a single configuration file

License: The Unlicense

Shell 100.00%

opellets's Introduction

OPellets

opellets [<config>] [--aur-install <command>]

A declarative pacman wrapper for Arch Linux. The goal of opellets is to allow you to tersely specify what packages you expect to be installed and keep your system tidy by removing packages that aren't needed. It's also great for bootstrapping a new system. OPellets doesn't prevent you from installing new packages manually to try them out, but it will help you remember to keep a transcript of those you want to stay around.

You start by specifying an annotated file of packages you want installed, like this:

# Apps
google-chrome [aur]
vlc

# Tools
maim # used to take screenshots

# X11
xorg [group]
xmonad

Then, when you run opellets, it will look at the current explicitly-installed packages, compare them to the list, and install, remove, or modify to make your system match the config file.

$ opellets
install maim
remove scrot
mark-explicit xorg-xrandr

Proceed? [Y/n/dry]:

The specific actions it can take are:

in config install reason action
yes not installed install
yes installed as dep mark-explicit
yes explicitly installed none
no not installed none
no installed as dep none
no explicitly installed mark-dependency OR remove

Marking a package as an explicit installation or dependency is mostly for bookkeeping purposes. It uses this information to prompt to prune unused dependency packages after the previous step is complete.

Config File

You can specify a path to a config file on the command line. If none is specified, opellets will look in the default location using XDG Base Directory specification which is typically ~/.config/opellets/packages. Note that when run with sudo, ~ will resolve to the calling user's $HOME directory. If you are using $XDG_CONFIG_HOME, you must use sudo -E to preserve the environment. Or just run opellets without sudo as it will call pacman with sudo.

A config file is simply a list of packages and comments. Comments begin with a # and can appear at any point in the line. Packages are specified one per line. There are two modifiers for packages:

  • [aur] indicates that this package is built via the Arch User Repository (see below)
  • [group] indicates that this is a package group

You may also specify a provision instead of a package in the same way you could for pacman. This means that "python-neovim" and "python-pynvim" would both match against the python-pynvim package which provides "python-neovim".

Provision and group resolution happens on each run. This means that if a group was installed and a package was later added to the group, that new package will be installed on the next run of opellets. This is inconsistent with how pacman works -- pacman only remembers the actual packages that were installed, not by what method they were installed.

If a package is not explicitly listed and only optionally depended on by other packages, it will be removed. You should add it to your config if you wish to keep it.

Starting out

If you're starting from a blank slate, you can query what is currently installed on your system:

$ pacman -Q --quiet --explicit --native && pacman -Q --quiet --explicit --foreign | xargs printf "%s [aur]\n"

Many of these packages will come from groups. If you want to learn about what groups you might have installed, use pacman -Q --explicit --groups to get a hint. The most common groups are base-devel and xorg.

AUR Packages

By default, AUR packages are not installed since this isn't intended to be an entire toolchain for building AUR packages. Instead, you can optionally pass a command prefix with --aur-install that accepts packages on the command line. For example:

opellets --aur-install "paru -S"

Alternatively, you can place an executable file at the path $XDG_CONFIG_HOME/opellets/aur-install (where $XDG_CONFIG_HOME defaults to ~/.config). If --aur-install is not specified and the file is present, it will be used. For example:

#!/usr/bin/env bash
exec paru -S "$@"

Installation

curl -O https://raw.githubusercontent.com/opekope2/opellets/main/PKGBUILD
makepkg -si

opellets's People

Contributors

dpatti avatar opekope2 avatar

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.