Skip to content

feat: add Nix flake for NixOS/Nix support#48

Merged
danieljustus merged 2 commits into
mainfrom
issue/36-support-nixos-nix-flake-nixpkgs
May 15, 2026
Merged

feat: add Nix flake for NixOS/Nix support#48
danieljustus merged 2 commits into
mainfrom
issue/36-support-nixos-nix-flake-nixpkgs

Conversation

@danieljustus
Copy link
Copy Markdown
Owner

Summary

  • Add flake.nix using buildGoModule for reproducible Nix builds
  • Add Nix install instructions to README.md and docs/distribution.md
  • Update platform tables to include NixOS/Nix

Details

The flake provides:

  • packages.default — OpenPass built via buildGoModule (CGO_ENABLED=0 for Linux)
  • apps.defaultnix run github:danieljustus/OpenPass support
  • devShells.default — development shell with Go tooling

Note: vendorHash is set to "" and needs to be resolved on first nix build. The build will fail with the correct SRI hash — copy it into flake.nix to pin Go dependencies.

Fixes #36

- Add flake.nix with buildGoModule package definition, default app, and dev shell
- Update README.md with Nix install instructions and platform table entry
- Update docs/distribution.md with Nix flake section

Fixes #36
Copilot AI review requested due to automatic review settings May 15, 2026 07:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial Nix flake support for building and running OpenPass through the Nix ecosystem, alongside documentation updates for the new install channel.

Changes:

  • Adds flake.nix with a Go package, default app, and development shell.
  • Documents Nix flake usage in README and distribution docs.
  • Updates support tables to list NixOS/Nix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
README.md Adds Nix install instructions and platform table entry.
flake.nix Defines Nix package/app/dev shell for OpenPass.
docs/distribution.md Adds NixOS/Nix support entry and Nix flake install section.
Comments suppressed due to low confidence (1)

flake.nix:29

  • Leaving vendorHash empty makes the buildGoModule derivation fail before it can build OpenPass, so nix build/nix run will not work for users and the Go dependency set is not pinned. This needs to be replaced with the real SRI hash before the flake can satisfy the Nix support acceptance criteria.
          vendorHash = "";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread flake.nix
Comment on lines +5 to +6
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
Comment thread flake.nix

# Disable CGO for Linux — reduces distributability and is not needed
# (keyring integration requires CGO only on darwin).
CGO_ENABLED = 0;
Comment thread flake.nix
Comment on lines +53 to +55
apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
};
Comment thread README.md
Comment on lines +59 to +68
```bash
# Run directly (no install needed)
nix run github:danieljustus/OpenPass

# Or add as a flake input
# flake.nix:
# inputs.openpass.url = "github:danieljustus/OpenPass";
```
> **Note:** The flake is new. Run `nix build` once to resolve the Go module dependency hash (`vendorHash` in `flake.nix`), then submit a PR with the pinned hash.

Comment thread docs/distribution.md Outdated
# inputs.openpass.url = "github:danieljustus/OpenPass";
```

> **Note:** The flake is new. Run `nix build` once to resolve the Go module dependency hash (`vendorHash` in `flake.nix`), then submit a PR with the pinned hash.
Comment thread flake.nix
pkgs = import nixpkgs { inherit system; };
in
{
packages.default = pkgs.buildGoModule {
Replace the placeholder vendorHash with the resolved SRI hash for Go module dependencies.

Updates docs to reflect that vendorHash is now pinned and provides instructions for updating it when dependencies change.

Refs #36
@danieljustus danieljustus merged commit 4c8135c into main May 15, 2026
18 checks passed
@danieljustus danieljustus deleted the issue/36-support-nixos-nix-flake-nixpkgs branch May 15, 2026 08:43
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.

Support NixOS (Nix flake / nixpkgs)

2 participants