Gentoo Options Centralization Kit. A tool to manage your gentoo systems configuration, all from a single file
Find a file
2026-03-25 20:32:08 +00:00
gock Fix repos.conf not existing 2026-03-17 18:45:20 +00:00
gock-example.yaml Initial commit 2026-03-17 18:23:44 +00:00
README.md Update README 2026-03-25 20:32:08 +00:00

Gock

What is gock?

Gock (Gentoo Options Centralization Kit) is a simple too which uses portage's existing functions to manage your gentoo system from a single YAML file. It was initiall made out of my desire for a nixos without the nix, and while it admittedly falls a little short, its a half decent stand in.

Gock can manage your installed packages, USE flags, portage overlays and openrc services through the editing of a YAML file in /etc/portage and then simply running gock, which will update your portage config to match the YAML file.

Installation

Gock will soon have a proper ebuild, but for now it can be downloaded directly. If you are using gock during a gentoo install and following the handbook, this should be done directly after chrooting into the new system. The handbook should then be followed as usual, but any installation of packages, setting of use flags or changing openrc services should be performed with gock rather than as outlined in the handbook.

To download, as a root user simply cd to /usr/bin and use wget:

cd /usr/bin
wget https://git.ceressees.dev/ceres-sees-all/gock/raw/branch/mistress/gock
chmod +x gock

you should then create the file /etc/portage/gock.yaml, which is where we will do all our config!

Usage

All gock configuration is performed through editing the /etc/portage/gock.yaml (referred to as the gock file from here on). The gock file has a potential 6 sections, all of which are optional, and are outligned below. It is also worth taking a breif look at the gock-example.yaml file in this repository to get a general idea of how the file should be layed out.

Packages

The packages section writes to the portage world file, and dictates all the required packages which should be installed, along with their dependencies which will be calculated by portage. Each desired package should be given its own line, and MUST be the full package form, i.e. catagory/package. Additionally, you may specify version or repository in standard gentoo fashion.

packages:
    - sys-kernel/gentoo-kernel
    - app-misc/yazi::guru
    - =sys-fs/zfs-2.4.1
    - <=sys-boot/zfsbootmenu-3.1.0

Use

The use section manages the USE flags of any packages installed, not just the ones declared in the gock file. Again, each package should be given its own line, and all configuration for a package should be on one line, rather than being split across multiple. The flags themselves should be in quotations.

use:
    sys-kernel/instalkernel: "dracut"
    net-misc/openssh: "security-key"
    sys-apps/systemd-utils: "boot kernel-install"

Make

The make section outlines the content in the make.conf file. All variables should be the same as they would usually be in the make.conf file, and values should be placed in quotes.

make:
  WARNING_FLAGS: "-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
  
  COMMON_FLAGS: "-O2 -pipe -march=native -flto ${WARNING_FLAGS}"
  CFLAGS: "${COMMON_FLAGS}"
  CXXFLAGS: "${COMMON_FLAGS}"
  FCFLAGS: "${COMMON_FLAGS}"
  FFLAGS: "${COMMON_FLAGS}"
  RUSTFLAGS: "${RUSTFLAGS} -C target-cpu=native"

Repos

The repos section defines the repositories available to portage. Each repository should have both a sync type and a sync URI. The standard gentoo repository should be configured here to avoid issues, as well as any others the user desires.

repos:
  gentoo:
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
  guru:
    sync-type: git
    sync-uri: https://https://github.com/gentoo-mirror/guru.git 
  ceres-ebuilds:
    sync-type: git
    sync-uri: https://git.ceressees.dev/ceres-sees-all/ceres-ebuilds.git

Runlevels

The runlevels section manages any openrc services. Any service not defined here will be left as its default option, regardless of if that is in a runlevel or not. If the user whises to remove a service from all runlevels, they should se the value to none.

runlevels:
  dbus: none
  zfs-import: sys-init
  sysklogd: default

Imports

The imports section can be used to spread your config over multiple files. Any YAML file listed here will be added to hte gock configuration as well, though it does not work recursively, so any imports defined in an imported file will not be added. Files are located relative to /etc/portage.

imports:
  - kernel.yaml
  - games/steam.yaml

Writing the config

After the gock file is edited to the users liking, it can be written to portage by simply excecuting gock with root privileges. This can then be applied by running emerge --sync if there has been any changes to the repositories section, and then emerge -avdutN @world to install packages and update their USE flags.