I am learning how to package the apache mod_tls module for nix and have run into various roadblocks.
I am noting my specific gaps in knowledge here.
I hope to formalize these into questions and answers for packaging 101 or to keep as wiki-style example of how to packaging something in nix without being an expert.
how do I generate the sha256 value expected by stdenv.mkDerivation?
I’m unsure how to do this for things like apache modules which seem more internal to another package.
The documentation says nix-build -A packageName.
But I am packaging an apache module which doesn’t appear to work with nix-build -A mod_tls.
My current workaround is to run nix-build --show-trace -A apacheHttpdPackages_2_4 in my modified source tree.
I’ll assume you’re running on NixOS and interested in using apache on NixOS.
There are a number of ways to test packages, but apache specifically is pretty tightly tied to the NixOS module unless you want to write your own configs. I like to use NixOS containers to do simple apache tests. Since you’re dealing with mod_tls that might present a few obstacles, but should be fine.
This sounds great!
Thank you for sharing your workflow and core snippets. That will save me hours of trial and error learning. I hope to bring mod_tls to the nixpkgs ecosystem. I figured working on packaging from a nixOS instance makes the most sense.
Using git worktree here seems quite compelling. Have you written up or know of any posts that describe the nixos-container and git worktree workflow?
My git paradigm just shifted because worktrees let you “check out more than one branch at a time”!
@jonringer thanks for the video tutorial link! I’m sure that addresses the topic perfectly for a clueless beginner like me.