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 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.