Guix: creating a package from a binary

Lobsters Hottest Tools

Summary

A guide on creating a Guix package from a binary using the copy-build-system, explaining how to set up an install plan.

<p><a href="https://lobste.rs/s/rvtn4v/guix_creating_package_from_binary">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 07/16/26, 09:55 AM

# Guix: creating a package from a binary Source: [https://aloysberger.com/posts/guix-packaging-a-binary-as-a-guix-beginner.html](https://aloysberger.com/posts/guix-packaging-a-binary-as-a-guix-beginner.html) We now have the metadata and the source\. The last missing piece is the building instructions\. Guix offers out of the box[multiple build systems](https://guix.gnu.org/manual/1.5.0/en/html_node/Build-Systems.html)for different use cases\. For example, the \`gnu build system\` is designed for projects following the \`GNU coding standard\`\. You will find many others build systems such as node, zig or golang\. Each build system exposes \`arguments\` to customise the build process to your need\. The \`<package\>\` record can also include \`inputs\`, which specifies the build\-time or run\-time dependencies of the package\. Our case is simple, there are no dependencies as the package is already built\. We simply need to copy the executable to the right location\. Guix has a build system for this, the \`copy\-build\-system\`, which expose only one argument: \`install\-plan\`\. The \`install\-plan\` argument is used to instruct where to copy files\. In our use case, we simply want to copy the binary into the packages' \`/bin\` directory\. ``` (build-system copy-build-system) (arguments (list #:install-plan #~'(("caddy" "bin/")))) ``` Note that the binary isn't installed in the user or root binary folder\. It will be installed in the store, at \`/gnu/store/<\*ENTITY\*\>additionalhellip\-caddy\-2\.11\.4/bin/caddy\` To make it available to your user, you will need to add it as a user package, a system package or within a service\. In this case, I intend to use it for my \`caddy\-service\` which I'll go over in a future post\.

Similar Articles

GuixPkgs: every Guix package, as a Nix flake

Lobsters Hottest

GuixPkgs is a project that makes every GNU Guix package available as a Nix flake, allowing users to mix Guix and Nixpkgs packages in a single flake. It uses guix-transfer to convert Guix derivations to Nix derivations and provides a binary cache to avoid rebuilding the entire Guix bootstrap.

Nix Flakes and their Guix Equivalents

Lobsters Hottest

A detailed comparison between Nix Flakes and their equivalents in the Guix package management system, covering dependency declarations, pinning, purity, outputs, development environments, and system configuration.

Time travel without borders

Lobsters Hottest

The article discusses a new feature in GNU Guix's `time-machine` and `pull` commands that allows for one-line deployment of software from channels while addressing security concerns associated with downloading and executing untrusted code.