meta_package_manager.managers.guix module¶
- class meta_package_manager.managers.guix.Guix[source]¶
Bases:
PackageManagerGNU Guix, GNU’s functional package manager.
Note
All operations target the current user’s default profile. Declarative system configuration (Guix System
config.scm) is not covered.Guix is a rolling release with no upstream semver to pin against:
guix --versionreports a release tag, agit describestring, or the bare commit hash of an in-tree checkout. Norequirementfloor is enforced, since any workingguixwill do.Warning
searchevaluates every package definition to match the query, so its cost scales with the size of the package set, not the result count: tens of seconds on a freshly pulled Guix, longer still from an in-tree development checkout. The call is bounded bympm --timeout(120s by default), past which it is killed with no results returned, so a slow search can look like a hang.Initialize
cli_errorslist.- name: str = 'GNU Guix'¶
Return package manager’s common name.
Default value is based on class name.
- homepage_url: str | None = 'https://guix.gnu.org'¶
Home page of the project, only used in documentation for reference.
- logo: str | None = 'gnu'¶
Slug of the brand mark standing for this manager in the documentation.
Names an SVG vendored under
docs/assets/managers/, whose provenance and license are recorded indocs/assets/managers/logos.yaml. Inlined at the top of the manager’s page bymeta_package_manager._docs; a manager leaving it unset keeps the page’s default package glyph.Several managers legitimately share one slug, either because they wrap the same upstream (
brewandcask) or because the tool has no mark of its own and its ecosystem’s stands in (aptunder Debian’s swirl,cargounder Rust’s gear). Documentation-only, likehomepage_url: no CLI output reads it.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='almalinux', name='AlmaLinux'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='endeavouros', name='EndeavourOS'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='pikaos', name='PikaOS'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})¶
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a
frozensetofPlatforminstances at instantiation.
- version_regexes: tuple[str, ...] = ('guix \\(GNU Guix\\) (?P<version>\\d[\\w.\\-+]*)', 'guix \\(GNU Guix\\) (?P<version>[0-9a-f]{7,40})\\b')¶
$ guix --version guix (GNU Guix) 1.4.0
- property installed: Iterator[Package]¶
Fetch installed packages.
Output is tab-separated: name, version, output, store path.
$ guix package --list-installed hello 2.10 out /gnu/store/k74skdjjb9c9zqjv9nmgd6zi92wpf3q0-hello-2.10 python 3.10.7 out /gnu/store/2n3g8n7d5xkp6h4qz1v8m0rjc9wf5aby-python-3.10.7
- property outdated: Iterator[Package]¶
Fetch outdated packages.
Relies on
guix upgrade --dry-runwhich lists every package that would be upgraded without modifying the user profile.$ guix upgrade --dry-run The following packages would be upgraded: hello 2.12.1 → 2.12.3 sed 4.8 → 4.9
- search(query, extended, exact)[source]¶
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.Caution
guix searchloads and evaluates every package definition to match the query against each package’s name, synopsis, and description, so it is inherently slow: its cost scales with the size of the package set, not the number of results. A single search runs for tens of seconds on a freshly pulled Guix, and far longer from an in-tree dev checkout that recompiles modules on the fly. The call is bounded bympm --timeout; when that is unset,searchuses the 120s read-only default, past which the process is killed and no results are returned, so a slow search can look like a hang.Results are printed in recutils format with records separated by blank lines.
$ guix search hello name: hello version: 2.10 outputs: out systems: x86_64-linux i686-linux dependencies: [email protected] ... location: gnu/packages/base.scm:86:2 homepage: https://www.gnu.org/software/hello/ license: GPL 3+ synopsis: Hello, GNU world: an example GNU package description: GNU Hello prints the message "Hello, world!" + and then exits. It serves as an example of standard + GNU coding practices. relevance: 10
- upgrade_one_cli(package_id, version=None)[source]¶
Generates the CLI to upgrade one package.
$ guix upgrade hello
- cli_names: tuple[str, ...] = ('guix',)¶
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this property’s value is derived from the manager’s ID (see the
MetaPackageManager.__init__method above).
- id: str = 'guix'¶
Package manager’s ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.