{"id":13875919,"url":"https://github.com/steven-omaha/pacdef","last_synced_at":"2025-05-16T07:07:06.135Z","repository":{"id":47554921,"uuid":"331946031","full_name":"steven-omaha/pacdef","owner":"steven-omaha","description":"multi-backend declarative package manager for Linux","archived":false,"fork":false,"pushed_at":"2024-07-31T21:53:54.000Z","size":788,"stargazers_count":351,"open_issues_count":19,"forks_count":13,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-10T11:47:23.443Z","etag":null,"topics":["declarative","linux","package-manager","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steven-omaha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-22T12:55:06.000Z","updated_at":"2025-05-05T22:28:49.000Z","dependencies_parsed_at":"2024-01-13T19:40:17.613Z","dependency_job_id":"f66f4a7a-fbfc-4e3d-b419-c5b4f52c5d47","html_url":"https://github.com/steven-omaha/pacdef","commit_stats":{"total_commits":361,"total_committers":4,"mean_commits":90.25,"dds":"0.16066481994459836","last_synced_commit":"2791c231971993b3fe6ad9d9c2632b125e657cc2"},"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steven-omaha%2Fpacdef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steven-omaha%2Fpacdef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steven-omaha%2Fpacdef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steven-omaha%2Fpacdef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steven-omaha","download_url":"https://codeload.github.com/steven-omaha/pacdef/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485065,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["declarative","linux","package-manager","rust"],"created_at":"2024-08-06T06:00:49.942Z","updated_at":"2025-05-16T07:07:01.126Z","avatar_url":"https://github.com/steven-omaha.png","language":"Rust","funding_links":[],"categories":["Rust","rust"],"sub_categories":[],"readme":"[![check](https://github.com/steven-omaha/pacdef/actions/workflows/check.yml/badge.svg)](https://github.com/steven-omaha/pacdef/actions/workflows/check.yml)\n\n# pacdef\n\nmulti-backend declarative package manager for Linux\n\n\n## Installation\n\n### Arch Linux\n`pacdef` is available in the AUR [as stable release](https://aur.archlinux.org/packages/pacdef) or [development version](https://aur.archlinux.org/packages/pacdef-git) or [binary version](https://aur.archlinux.org/packages/pacdef-bin).\n\n### binaries for other Linux versions\nFor every release since 1.5.0 you can download binaries for some other Linux versions.\nCheck out the assets for the [latest release](https://github.com/steven-omaha/pacdef/releases).\n\n### from source\n\nInstall it from [crates.io](https://crates.io/crates/pacdef) using this command.\n```bash\n$ cargo install [-F \u003cbackend\u003e[,...]] pacdef\n```\n\nSee below (\"[supported backends](#supported-backends)\") for the feature flags you will need for your distribution.\n\n### shell completion\n\nFor Arch Linux, zsh completion will work automatically when you install pacdef from the AUR packages.\nFor other distributions you must copy the `_completion.zsh` file to the right folder manually and rename it to `_pacdef`.\n\n## Use-case\n\n`pacdef` allows the user to have consistent packages among multiple Linux machines and different backends by managing packages in group files.\nThe idea is that (1) any package in the group files (\"managed packages\") will be installed explicitly, and (2) explicitly installed packages *not* found in any of the group files (\"unmanaged packages\") will be removed.\nThe group files are maintained outside of `pacdef` by any VCS, like git. \n\nIf you work with multiple Linux machines and have asked yourself \"*Why do I have the program that I use every day on my other machine not installed here?*\", then `pacdef` is the tool for you.\n\n\n### Of groups, sections, and packages\n\n`pacdef` manages multiple package groups (group files) that, e.g., may be tied to a specific use-case.\nEach group has one or more section(s) which correspond to a specific backend, like your system's package manager (`pacman`, `apt`, ...), or your programming languages package manger (`cargo`, `pip`, ...).\nEach section contains one or more packages that can be installed respective package manager.\n\nThis image illustrates the relationship.\n```\n       1   n       1   n         1   n      \npacdef ----\u003e group ----\u003e section ----\u003e package \n```\n\n\n\n### Example\n\nLet's assume you have the following group files.\n\n`base`:\n\n```ini\n[arch]\nparu\nzsh\n\n[rust]\npacdef\ntopgrade\n```\n\n`development`:\n\n```ini\n[arch]\nrustup\nrust-analyzer\n\n[rust]\ncargo-tree\nflamegraph\n```\n\nPacdef will make sure you have the following packages installed for each package manager:\n\n- Arch (`pacman`, AUR helpers): paru, zsh, rustup, rust-analyzer\n- Rust (`cargo`): pacdef, topgrade, cargo-tree, flamegraph\n\nNote that the name of the section corresponds to the ecosystem it relates to, rather than the package manager it uses.\n\n## Supported backends\n\nAt the moment, supported backends are the following.\nPull requests for additional backends are welcome!\n\n| Application  | Package Manager | Section     | feature flag | Notes                                                                                    |\n| ------------ | --------------- | ----------- | ------------ | ---------------------------------------------------------------------------------------- |\n| Arch Linux   | `pacman`        | `[arch]`    | `arch`       | includes pacman-wrapping AUR helpers (configurable)                                      |\n| Debian       | `apt`           | `[debian]`  | `debian`     | minimum supported apt-version 2.0.2 ([see upstream](https://gitlab.com/volian/rust-apt)) |\n| Fedora Linux | `dnf`           | `[fedora]`  | built-in     |                                                                                          |\n| Flatpak      | `flatpak`       | `[flatpak]` | built-in     | can manage either system-wide or per-user installation (configurable)                    |\n| Python       | `pip`           | `[python]`  | built-in     |                                                                                          |\n| Rust         | `cargo`         | `[rust]`    | built-in     |                                                                                          |\n| Rustup       | `rustup`        | `[rustup]`  | built-in     | See the comments [below](#rustup) about the syntax of the packages in the group file.    |\n| Void Linux   | `xbps`          | `[void]`    | built-in     |                                                                                          |\n\nBackends that have a `feature flag` require setting the respective flag for the build process.\nThe appropriate system libraries and their header files must be present on the machine and be detectable by `pkg-config`.\nFor backends that state \"built-in\", they are always supported during compile time.\nAny backend can be disabled during runtime (see below, \"[Configuration](#configuration)\").\n\nFor example, to build `pacdef` with support for Debian Linux, you can run one of the two commands.\n* (recommended) `cargo install -F debian pacdef`, this downloads and builds it from [https://crates.io](https://crates.io)\n* in a clone of this repository, `cargo install --path . -F debian`\n\n### Example\n\nThis tree shows my pacdef repository (not the `pacdef` config dir).\n```\n.\n├── generic\n│   ├── audio\n│   ├── base\n│   ├── desktop\n│   ├── private\n│   ├── rust\n│   ├── wayland\n│   ├── wireless\n│   ├── work\n│   └── xorg\n├── hosts\n│   ├── hostname_a\n│   ├── hostname_b\n│   └── hostname_c\n└── pacdef.toml\n```\n\n- The `base` group holds all packages I need unconditionally, and includes things like zfs,\n  [paru](https://github.com/Morganamilo/paru) and [neovim](https://github.com/neovim/neovim).\n- In `xorg` and `wayland` I have stored the respective graphic servers and DEs.\n- `wireless` contains tools like `iwd` and `bluez-utils` for machines with wireless interfaces.\n- Under `hosts` I have one file for each machine I use. The filenames match the corresponding hostname. The packages\n  are specific to one machine only, like device drivers, or any programs I use exclusively on that machine.\n\nUsage on different machines: \n\n- home server: `base private hostname_a`\n- private PC: `audio base desktop private rust wayland hostname_b`\n- work PC: `base desktop rust work xorg hostname_c`\n\n\n## Commands\n\n| Subcommand                        | Description                                                           |\n|-----------------------------------|-----------------------------------------------------------------------|\n| `group import [\u003cpath\u003e...]`        | create a symlink to the specified group file(s) in your groups folder | \n| `group export [args] \u003cgroup\u003e ...` | export (move) a non-symlink group and re-import it as symlink         | \n| `group list`                      | list names of all groups                                              |  \n| `group new [-e] [\u003cgroup\u003e...]`     | create new groups, use `-e` to edit them immediately after creation   | \n| `group remove [\u003cgroup\u003e...]`       | remove a previously imported group                                    |\n| `group show [\u003cgroup\u003e...]`         | show contents of a group                                              |  \n| `package clean [--noconfirm]`     | remove all unmanaged packages                                         |\n| `package review`                  | for each unmanaged package interactively decide what to do            |\n| `package search \u003cregex\u003e`          | search for managed packages that match the search string              |\n| `package sync [--noconfirm]`      | install managed packages                                              |\n| `package unmanaged`               | show all unmanaged packages                                           |\n| `version`                         | show version information, supported backends                          |\n\n### Aliases\n\nMost subcommands have aliases. \nFor example, instead of `pacdef package sync` you can write `pacdef p sy`, and `pacdef group show` would become `pacdef g s`.\n\nUse `--help` or the zsh completion to find the right aliases.\n\n\n## Configuration\n\nOn first execution, it will create an empty config file under `$XDG_CONFIG_HOME/pacdef/pacdef.toml`.\nThe following key-value pairs can be set.\nThe listed values are the defaults.\n\n```toml\naur_helper = \"paru\"  # AUR helper to use on Arch Linux (paru, yay, ...)\naur_rm_args = []  # additional args to pass to AUR helper when removing packages (optional)\ndisabled_backends = []  # backends that pacdef should not manage, e.g. [\"python\"], this can reduce runtime if the package manager is notoriously slow (like pip)\n\nwarn_not_symlinks = true  # warn if a group file is not a symlink\nflatpak_systemwide = true  # whether flatpak packages should be installed system-wide or per user\npip_binary = \"pip\"  # choose whether to use pipx instead of pip for python package management (see below, 'pitfalls while using pipx')\n```\n\n\n## Group file syntax\n\nGroup files loosely follow the syntax for `ini`-files.\n\n1. Sections begin by their name in brackets.\n2. One package per line. \n3. Anything after a `#` is ignored.\n4. Empty lines are ignored.\n5. If a package exists in multiple repositories, the repo can be specified as prefix followed by a forward slash.\n   The package manager must understand this notation.\n\nExample:\n```ini\n[arch]\nalacritty\nfirefox  # this comment is ignored\nlibreoffice-fresh\nmycustomrepo/zsh-theme-powerlevel10k\n\n[rust]\ncargo-update\ntopgrade\n```\n\n### Rustup\n\nRustup packages are managed quite differently. For referring to the syntax, have a look [below](#group-file-syntax).\nIn contrast to other package managers, rustup handles package naming very differently.\nThese packages are either of the form `toolchain/\u003cVERSION\u003e` or `component/\u003cVERSION\u003e/\u003ccomponent\u003e`, where \u003cVERSION\u003e can be stable, nightly, or any explicit rust version.\nThe `\u003ccomponent\u003e` field has to be substituted with the name of the component you want installed.\n\nExample:\n\n```ini\n[rustup]\ncomponent/stable/rust-analyzer\ntoolchain/stable\ncomponent/stable/cargo\ncomponent/stable/rust-src\ncomponent/stable/rustc\ntoolchain/1.70.0\ncomponent/1.70.0/cargo\ncomponent/1.70.0/clippy\ncomponent/1.70.0/rust-docs\ncomponent/1.70.0/rust-src\ncomponent/1.70.0/rust-std\ncomponent/1.70.0/rustc\ncomponent/1.70.0/rustfmt\n```\n\n## Misc.\n\n### Automation\n\nPacdef is supported by [topgrade](https://github.com/topgrade-rs/topgrade).\n\n### Naming\n\n`pacdef` combines the words \"package\" and \"define\".\n\n\n### minimum supported rust version (MSRV)\n\nMSRV is 1.74 due to dependencies that require this specific version. Development is conducted against the latest stable version.\n\n\n### Pitfalls while using pipx\n\nSome packages like [mdformat-myst](https://github.com/executablebooks/mdformat-myst) do not provide an executable themselves but rather act as a plugin to their dependency, which is mdformat in this case. Please install such packages explicitly by running `pipx install \u003cpackage-name\u003e --include-deps`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteven-omaha%2Fpacdef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteven-omaha%2Fpacdef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteven-omaha%2Fpacdef/lists"}