<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk" -->

---
title: Guix: creating a package from a binary | daily.dev
description: A practical walkthrough of creating a Guix package from a pre-built binary, using Caddy web server as the example. Covers defining a `<package>` record with...
canonical: https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Guix: creating a package from a binary | daily.dev
og:description: A practical walkthrough of creating a Guix package from a pre-built binary, using Caddy web server as the example. Covers defining a `<package>` record with...
og:url: https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk
og:image: https://api.daily.dev/og/posts/ONjxNycnk.png
og:image:alt: Guix: creating a package from a binary
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Guix: creating a package from a binary

**[Lobsters](https://daily.dev/sources/lobsters)** · 6 min read · 0 upvotes · 0 comments

## Summary

A practical walkthrough of creating a Guix package from a pre-built binary, using Caddy web server as the example. Covers defining a `<package>` record with metadata, fetching the binary via `url-fetch` with SHA256 integrity verification using `guix download`, and using the `copy-build-system` with an `install-plan` to place the binary in the package's bin directory. Useful when source packaging is not yet available or too complex.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://aloysberger.com/posts/guix-packaging-a-binary-as-a-guix-beginner.html>

## Questions this post answers

### How do I package a pre-built binary in Guix instead of building from source?

Use the copy-build-system, which only exposes an install-plan argument telling Guix where to copy files, such as copying a binary into the package's bin/ directory. Combine this with a source origin using url-fetch to download the binary and a sha256 hash for integrity verification, avoiding the need to package build dependencies.

_Developers packaging tools for Guix can compare approaches and edge cases surfaced on daily.dev._

### How do I get the sha256 hash for a Guix package source when the binary isn't packaged yet?

Run guix download followed by the URL of the file, such as a GitHub release tarball. The command downloads the resource, stores it in the Guix store, and prints a base32-encoded sha256 hash as the last line of output, which is then used in the origin record's sha256 field to verify content integrity on future builds.

_Anyone building reproducible Guix packages can find similar practical walkthroughs on daily.dev._

### Is Caddy web server available as a package in Guix?

Caddy is not yet packaged from source in Guix because doing so requires first packaging a dozen Go sub-dependencies, though volunteers were working on it. As a workaround, Caddy 2.11.4 can be packaged directly from its official GitHub release binary using the copy-build-system rather than compiling from source.

_Homelab builders tracking Guix packaging gaps for tools like Caddy can follow updates on daily.dev._

## Similar posts on daily.dev

- [Writing a Guix service from scratch, as a beginner](https://daily.dev/posts/writing-a-guix-service-from-scratch-as-a-beginner-r9hybuqmw) · Lobsters · 0 upvotes · 0 comments
- [Guix by Nix](https://daily.dev/posts/guix-by-nix-rn05lpuy8) · Farid Zakaria’s Blog · 0 upvotes · 0 comments
- [Guix for development — dthompson](https://daily.dev/posts/guix-for-development-dthompson-avn20t8eg) · Hacker News · 0 upvotes · 0 comments
- [GuixPkgs: every Guix package, as a Nix flake](https://daily.dev/posts/guixpkgs-every-guix-package-as-a-nix-flake-6f8qmpfhb) · Farid Zakaria’s Blog · 0 upvotes · 0 comments
- [Switching to GNU Guix: A Beginner's Perspective](https://daily.dev/posts/switching-to-gnu-guix-a-beginner-s-perspective-t5jipcwp2) · Lobsters · 1 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux)

[View this post on daily.dev](https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Guix: creating a package from a binary","url":"https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk"},"datePublished":"2026-07-16T21:18:49.876Z","dateModified":"2026-09-14T09:28:04.085Z","description":"A practical walkthrough of creating a Guix package from a pre-built binary, using Caddy web server as the example. Covers defining a `<package>` record with...","image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","thumbnailUrl":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Guix: creating a package from a binary"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/guix-creating-a-package-from-a-binary-onjxnycnk#faq","mainEntity":[{"@type":"Question","name":"How do I package a pre-built binary in Guix instead of building from source?","acceptedAnswer":{"@type":"Answer","text":"Use the copy-build-system, which only exposes an install-plan argument telling Guix where to copy files, such as copying a binary into the package's bin/ directory. Combine this with a source origin using url-fetch to download the binary and a sha256 hash for integrity verification, avoiding the need to package build dependencies. Developers packaging tools for Guix can compare approaches and edge cases surfaced on daily.dev."}},{"@type":"Question","name":"How do I get the sha256 hash for a Guix package source when the binary isn't packaged yet?","acceptedAnswer":{"@type":"Answer","text":"Run guix download followed by the URL of the file, such as a GitHub release tarball. The command downloads the resource, stores it in the Guix store, and prints a base32-encoded sha256 hash as the last line of output, which is then used in the origin record's sha256 field to verify content integrity on future builds. Anyone building reproducible Guix packages can find similar practical walkthroughs on daily.dev."}},{"@type":"Question","name":"Is Caddy web server available as a package in Guix?","acceptedAnswer":{"@type":"Answer","text":"Caddy is not yet packaged from source in Guix because doing so requires first packaging a dozen Go sub-dependencies, though volunteers were working on it. As a workaround, Caddy 2.11.4 can be packaged directly from its official GitHub release binary using the copy-build-system rather than compiling from source. Homelab builders tracking Guix packaging gaps for tools like Caddy can follow updates on daily.dev."}}]}
```

