PackageKit option-1 flake: forked PackageKit daemon + Nix backend + managed-helper NixOS module (public; anonymous git pulls)
  • Nix 64.5%
  • Python 24.8%
  • Shell 10.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-28 23:45:16 -06:00
docs feat(catalog): GUI-gate gap log via .desktop presence (exclude CLI + ConsoleOnly/Terminal apps) 2026-11-28 23:45:16 -06:00
flake.nix PackageKit option-1 flake: forked daemon + Nix backend + managed-helper NixOS module 2026-11-26 08:26:53 -06:00
pk-catalog-curated.tsv feat(catalog): Flathub-primary + nixpkgs-harvest hybrid DEP-11 generator 2026-11-28 21:05:35 -06:00
pk-catalog-merge.py feat(catalog): GUI-gate gap log via .desktop presence (exclude CLI + ConsoleOnly/Terminal apps) 2026-11-28 23:45:16 -06:00
pk-catalog.nix feat(catalog): GUI-gate gap log via .desktop presence (exclude CLI + ConsoleOnly/Terminal apps) 2026-11-28 23:45:16 -06:00
pk-fork-package.nix Pin fork to b39054e: nix backend implements get_repo_list + repo_enable 2026-11-26 19:44:57 -06:00
pk-managed-helper.sh PackageKit option-1 flake: forked daemon + Nix backend + managed-helper NixOS module 2026-11-26 08:26:53 -06:00
pk-managed-policy PackageKit option-1 flake: forked daemon + Nix backend + managed-helper NixOS module 2026-11-26 08:26:53 -06:00
pk-managed.nix feat(catalog): Flathub-primary + nixpkgs-harvest hybrid DEP-11 generator 2026-11-28 21:05:35 -06:00
README.md Document the packagekit option-1 flake 2026-11-26 08:48:31 -06:00

packagekit-flake

PackageKit option 1 for NixOS: a forked PackageKit daemon with a Nix backend, plus a managed-helper NixOS module. It lets a GUI "install/remove" action (for example from KDE Discover) land on the declarative system: the action edits a small JSON file and runs nixos-rebuild, producing a normal, rollback-able NixOS generation with no drift outside the Nix store.

This flake is the reusable Nix glue. It is hosted under the Public org so a consumer's root can fetch it over anonymous HTTPS with no deploy key.

Outputs

  • nixosModules.default (alias nixosModules.packagekit) — the pk-managed.nix module. It installs the fork daemon, sets DefaultBackend=nix, writes PackageKit.conf/Vendor.conf, registers the pk-managed-install/ pk-managed-remove CLI wrappers and their polkit actions, and exposes pk-nix-managed-helper.
  • overlays.default — overrides packagekit with the fork package.
  • packages.<system>.packagekit — the fork package by itself (the module uses this internally via callPackage ./pk-fork-package.nix).

The module reaches its siblings (pk-fork-package.nix, pk-managed-helper.sh, pk-managed-policy) by relative path, so the flake is self-contained: just add packagekit.nixosModules.default to your nixosSystem modules.

Files

File Role
pk-managed.nix NixOS module (the public interface).
pk-fork-package.nix Builds packagekit-1.4.0-pk-option1 via builtins.fetchGit of the fork daemon repo (branch option1-1.4.0), with -Dpackaging_backend=nix.
pk-managed-helper.sh Privileged helper for install/remove/status: validates the attribute path, edits the managed packages.json, and rebuilds with rollback.
pk-managed-policy polkit actions ca.randomrepair.pk-managed.install / .remove.

The daemon source is separate

No C/C++ lives in this flake. pk-fork-package.nix does a builtins.fetchGit of the forked daemon repo RandomRepair/PackageKit (branch option1-1.4.0). That repo is private; a host that builds it needs whatever credential that fetch uses (a deploy key). This flake's hosting in the Public org only governs how the flake itself is fetched.

Host glue stays out of this flake

How the helper rebuilds the system — reading a host-specific packages.json at an absolute path and resolving it into environment.systemPackages — is intentionally left to the consuming config (a managed-packages.nix on that host). This flake stays generic and reusable.

Request flow

KDE Discover  ->  packagekitd (fork, DefaultBackend=nix)
              ->  polkit ca.randomrepair.pk-managed.install|remove (AUTH_ADMIN_KEEP)
              ->  pk-managed-install / pk-managed-remove  (CLI wrappers)
              ->  pk-nix-managed-helper install|remove <attr>
                  1. flock to serialize
                  2. nix eval nixpkgs#<attr>.pname  (validate)
                  3. edit the host's packages.json
                  4. nixos-rebuild switch
              ->  host's managed-packages.nix resolves packages.json into systemPackages
              ->  new NixOS generation (or rollback on failure)

Pinning consequence for consumers

A consumer that rebuilds with --no-write-lock-file (as the helper does) uses the packagekit rev pinned in its flake.lock. Update this flake and a consumer picks it up only after running nix flake update packagekit there and deploying. Keep the lockfile tracked; a new input that is not git-tracked breaks flake eval.