PKG_REPO_CREATE(3)

πŸ“¦ version 2.7.5, in nixos 26.05, nixpkgs unstable

πŸ‘‘ PKG_REPO_CREATE(3) β€” the libpkg glow-up where you literally build a whole repo πŸ’…

okay bestie, so this page lives in the Library Functions Manual, and it's all about the libpkg crew that spins up a package repository from scratch. it's giving "let me just manifest a repo real quick" ✨


🌸 NAME 🌸

pkg_repo_create, pkg_repo_create_new, pkg_repo_create_free, pkg_repo_create_set_output_dir, pkg_repo_create_set_create_filelist, pkg_repo_create_set_hash, pkg_repo_create_set_hash_symlink, pkg_repo_create_set_metafile, pkg_repo_create_set_sign β€” create repository of packages πŸŽ€

no cap, that's the whole squad. every single one of them is on this page and we're covering all of them, don't worry πŸ’–


πŸ“š LIBRARY πŸ“š

library β€œlibpkg” β€” yep, that's where all these icons live 🫢


✨ SYNOPSIS ✨

#include <pkg.h>

struct pkg_repo_create *
pkg_repo_create_new();

void
pkg_repo_create_free(struct pkg_repo_create *);

bool
pkg_repo_create_set_output_dir(struct pkg_repo_create *, const char *);

void
pkg_repo_create_set_create_filelist(struct pkg_repo_create *, bool);

void
pkg_repo_create_set_hash(struct pkg_repo_create *, bool);

void
pkg_repo_create_set_hash_symlink(struct pkg_repo_create *, bool);

void
pkg_repo_create_set_metafile(struct pkg_repo_create *, const char *);

void
pkg_repo_create_set_sign(struct pkg_repo_create *, char **, int,
    pkg_password *);

int
pkg_repo_create(struct pkg_repo_create *, char *);

look at that signature lineup 😭 it's like a whole friend group walking in slow-mo. bool, void, int β€” everyone showed up πŸ’œ


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea on every single one of these functions, in order, no skips πŸ“

  • pkg_repo_create_new() β€” Allocates a new struct pkg_repo_create * which should be freed by the caller using pkg_repo_create_free(). so like, you birth this struct into existence and then you are responsible for its cleanup. main character energy comes with main character responsibilities, periodt πŸ’…
  • pkg_repo_create_set_output_dir() β€” defines the output directory to save the data in. By default it will be the path provided to the pkg_repo_create() function. lowkey convenient, it just reuses the path you already gave it πŸ™ˆ
  • pkg_repo_create_set_create_filelist() β€” Accept a boolean to define if the file database should be created along with the metadata database (deprecated). Defaults to false. ngl bestie, this one is deprecated, so maybe don't get too attached 😭 it's giving retired icon.
  • pkg_repo_create_set_hash() β€” When creating the repository, move all the packages found into a "Hashed" subdirectory with the "hash" of the package appended to the name of the package. Defaults to false. that's the whole hash-girl aesthetic β€” everything gets filed away with its little hash label on it πŸŽ€
  • pkg_repo_create_set_hash_symlink() β€” If the hash functionality has been activated, then there will be a symlink for each packages in the "Hashed" directory will be created in the root of the repository. Defaults to false. yes β€” symlinks in the root so nobody has to dig through the "Hashed" folder like it's a group chat with 400 unread messages πŸ”₯
⚠️ heads up bestie: this one only does its thing if the hash functionality has been activated. no hash, no symlinks β€” it's a package deal fr fr πŸ’€
  • pkg_repo_create_set_metafile() β€” Define the path to the metafile that will be used when creating the repository. If none is specified that it will fallback on the internal default. so you can pick your own metafile or just vibe with the built-in one ✨
  • pkg_repo_create_set_sign() β€” Define the signing mechanism, which will be used to sign the metadata of the repository. Defaults to none. signing the metadata = giving it that verified crown πŸ‘‘ because unsigned metadata is giving "who even are you" 🧚
  • pkg_repo_create() β€” Create a repository out of the packages found in the provided path. this is THE moment, the finale, the slay of the century 🌈 it takes all those packages and turns them into an actual repo. ate and left no crumbs πŸ“

πŸ¦‹ SEE ALSO πŸ¦‹

hmm nothing listed here, bestie β€” this page keeps its circle small πŸ’œ


quick recap: call pkg_repo_create_new() first, configure your vibe with the pkg_repo_create_set_* functions, run pkg_repo_create(), then pkg_repo_create_free() when you're done. iykyk 🫢

Debian πŸŽ€ December 12, 2025 β€” that's the version and date, bestie, straight from the source. this page ate and it's not coming back πŸ’…βœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from