Skip to content

Added a flake for build and packaging on Nix/NixOS. - #149

Closed
deephack1982 wants to merge 3 commits into
marcus:mainfrom
deephack1982:main
Closed

deephack1982 wants to merge 3 commits into
marcus:mainfrom
deephack1982:main

Conversation

@deephack1982

Copy link
Copy Markdown

Created a simple flake which can build and install sidecar on Nix/NixOS environments just in case you want that. To locally build and test simply run

nix build

To add to your NixOS system you can add an input and include the default package like this.

inputs = {
    sidecar.url = "github:deephack1982/sidecar";

## more inputs
};

environment.systemPackages = with pkgs; [
  inputs.sidecar.packages.${pkgs.stdenv.hostPlatform.system}.default
]

@deephack1982

Copy link
Copy Markdown
Author

Okay had to patch this up a bit as I included the wrong td :-D

NixOS snippet is now this.

inputs = {
    sidecar.url = "github:deephack1982/sidecar";

## more inputs
};

environment.systemPackages = with pkgs; [
  inputs.sidecar.packages.${pkgs.stdenv.hostPlatform.system}.sidecar
  inputs.sidecar.packages.${pkgs.stdenv.hostPlatform.system}.td
]

@marcus marcus left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @deephack1982 — thanks so much for this! NixOS support is genuinely useful for the community and the flake structure looks solid overall. Really appreciate you tracking down and fixing the wrong-td issue too.

A couple of things to address before we merge:

1. td version mismatch (important)

The flake pins td at v0.33.0, but sidecar's go.mod requires github.com/marcus/td v0.38.0 (latest is v0.39.0). A user installing both packages from this flake would get an older td CLI than what sidecar was built against, which is confusing. Could you bump this to v0.38.0 (or v0.39.0) with updated sha256 and vendorHash?

2. Deprecated defaultPackage output

The top-level defaultPackage attribute has been deprecated since Nix 2.7 in favour of packages.<system>.default — which you already have. You can just remove these lines:

defaultPackage = forAllSystems (system: self.packages.${system}.sidecar);

Everything else looks good — the buildGoModule setup, subPackages, ldflags, forAllSystems pattern, and the lock file are all correct. Once those two things are sorted I'm happy to merge.

@deephack1982

Copy link
Copy Markdown
Author

Thanks for the feedback Marcus. I'll revise this later today and update the PR.

@marcus

marcus commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Hey! Starling here (AI assistant on the project). 👋

Sounds great — looking forward to the revision. The Nix flake contribution is a nice addition for the NixOS crowd. Take your time, and feel free to ping here when it's updated. ✦

@marcus

marcus commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Hi @deephack1982, I am closing this, and since I am the one who said I was happy to merge it back in March, the reversal deserves an explanation.

The two changes I asked for never landed, but that is not really the reason. What changed my mind is thinking properly about what carrying a flake in this repo costs over time. vendorHash has to be regenerated on every dependency bump, and Sidecar bumps td and tasks constantly. The td pin here is a good illustration: it was one minor version behind when I reviewed it, and go.mod now requires v0.64.0 against the flake's 0.33.0. That drift is not your fault. It is just what happens to a pinned Nix expression living next to a fast-moving Go module.

The part I cannot solve is that nobody working on Sidecar runs Nix. A broken flake would sit broken until a NixOS user filed an issue, and I would have no way to verify a fix. I would rather not ship a packaging path I cannot test.

The good news is that nothing here is lost. The consumption pattern from your own description already works without this repo carrying anything:

inputs.sidecar.url = "github:deephack1982/sidecar";

A flake in your fork, or in a small standalone repo, gives NixOS users the same install, and you get to bump the pins on your schedule rather than mine. If that picks up users and you would like it linked from the README as a community package, I would happily take that PR.

Thanks for building it, and sorry for the reversal.

@marcus marcus closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants