Skip to content

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

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 — compiler, libraries, system dependencies — 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 (modulo timestamps). 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:owner/repo 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 only documents source builds (npm install). There is no one-command install path for users who already have Nix.

Proposed change

  • Add flake.nix with packages.default and apps.default
  • Add devbox.json for reproducible development environments
  • Update README install section to include Nix (flakes) and Devbox instructions

Branch

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

Implementation

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

The changes include:

  • flake.nix: Nix flake with packages.default and apps.default using Node.js 22 (Node.js 20 is marked as insecure)
  • devbox.json: Devbox configuration for reproducible development environments
  • README.md: added "With Nix (flakes)" and "With Devbox" install subsections

Tested locally with nix build . and binary execution verification.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions