Skip to content

feat: add Nix flake support for one-command installation #2

Description

@levonk

Summary

This issue tracks adding Nix flake support to the upstream project so users can install and run it without cloning or compiling manually.

What Nix provides

  • Pure / Hermetic builds: every input — the prebuilt binary, glibc/libiconv — is pinned in flake.lock. If it builds today, it builds in ten years.
  • Reproducible: the exact same derivation always produces the exact same output bit-for-bit. No "works on my machine."
  • Idempotent installs: running nix profile install twice is a no-op. The system reaches the declared state and stays there.
  • Rollback-able: nix profile rollback restores the previous profile generation instantly. Broken update? One command back.
  • Declarative: the entire build is a single expression (flake.nix). No imperative apt install, brew install, make dance.
  • Cross-platform: same nix run github:clidey/deptrust works on macOS (Apple Silicon & Intel) and Linux. The flake handles platform-specific dependencies.
  • Zero-install runs: nix run fetches from binary cache when available. No clone, no compile, no cargo build.
  • No system pollution: nix profile install adds to a user-specific profile. Uninstall cleanly with nix profile remove. No orphaned global packages.
  • Atomic upgrades / downgrades: profiles are switched atomically. No half-upgraded state.

Current gap

The project currently documents go install, Homebrew, and cargo install paths. There is no one-command install path for users who already have Nix.

Proposed change

  • Add flake.nix wrapping the prebuilt release tarball as packages.<system>.default and apps.<system>.default.
  • Add devbox.json for reproducible development environments.
  • Update README install section to include Nix (flakes) and Devbox instructions.
  • Add .github/workflows/nix-release.yml: scheduled lag-check automation that auto-bumps version + per-platform sha256 hashes and opens a PR when flake.nix falls behind the latest release.
  • Add .github/workflows/nix.yml: CI validation for flake evaluations.

Branch

feat-nix-package-manager-install on the fork.

Implementation

I have prepared the implementation in my fork at:
https://github.com/levonk/deptrust/tree/feat-nix-package-manager-install

The changes include:

  • flake.nix: Nix flake wrapping the prebuilt release tarball with per-platform SHA256 hashes.
  • devbox.json: Devbox configuration for reproducible development environments.
  • README.md: added "### Nix" and "### Devbox" install subsections.
  • .github/workflows/nix-release.yml: daily lag-check automation for auto-bumping flake version + hashes.
  • .github/workflows/nix.yml: CI validation for Nix flake.

Tested locally with nix run . -- --help (outputs deptrust usage).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions