Skip to content

Packages outside nixpkgs

Some programs installed by the framework do not exist in nixpkgs 🡕. Their build recipes live in dnf/pkgs/, and are exposed to all hosts like any other package, under pkgs.<name>.

Three locations exist for a package that is out of the ordinary, with three different intentions.

LocationFor whatLifespan
dnf/pkgs/Absent from nixpkgs, installed by hosts or users.Until published in nixpkgs.
dnf/lib/overlays/Fix for an existing nixpkgs package (broken build, pending PR).Temporary, listed in the registry.
inputs of dnf/flake.nixWhat the framework machinery needs (dnf-generator, colmena).Permanent.
dnf/pkgs/
├── default.nix <-- jeu de paquets, découvert depuis les dossiers
├── overlay.nix <-- le même jeu en overlay -> pkgs.<nom>
└── <nom>/package.nix <-- la dérivation

Un dossier = un paquet. default.nix scanne les dossiers, il n’y a donc aucun registre à tenir à jour. L’overlay, lui, est appliqué une fois pour toutes par dnf/lib/flake/mk-configuration.nix, sur tous les hôtes.

  1. Create dnf/pkgs/<nom>/package.nix, as a classic callPackage expression, with a complete meta (description, homepage, license, mainProgram, platforms). Pin the stable version, not a branch.

  2. git add the folder: flakes ignore untracked files.

  3. Build once to fix the hashes, which Nix displays in its error message :

    Fenêtre de terminal
    nix build .#<nom>
  4. just clean then commit.

Nothing else to wire up. The package can then be used in any NixOS module or Home Manager, like a nixpkgs package :

dnf/home/modules/advanced.nix
(lib.mkIf cfg.enableEssentials rename-simple)

Run it in dnf/ or at the root of a co-development project : a dnf/ linked to the Nix store is read-only.

Fenêtre de terminal
just pkg-update <nom>

nix-update 🡕 looks up the latest release published upstream, then rewrites the version and the hashes in package.nix. Then check the upstream changelog, rebuild, and commit.

The end goal, for every package of general interest :

  1. Move the folder into a nixpkgs clone, under the two-letter shard of the name (pkgs/by-name/re/rename-simple/).
  2. Add the maintainers entry, open the pull request.
  3. Once the PR is merged and made it into nixos-unstable, remove the folder from dnf/pkgs/.

pkgs.<name> keeps resolving, this time from nixpkgs: no module needs to be updated.