Skip to content

Add Nix flake support for package-manager installation #957

Description

@levonk

Summary

This issue tracks adding Nix flake support to FSL so users can install and run fslc without cloning or compiling manually.

What this adds

Enables nix run github:ymm-oss/fsl and nix profile add github:ymm-oss/fsl for users who already have Nix installed. The flake builds fslc (and fslc-lsp) from source with Z3 bundled in, with all inputs pinned in flake.lock. A devbox.json provides a reproducible development environment.

Current gap

The project documents three install routes — the install script, single-executable downloads from Releases, and developer setup from source. There is no one-command install path for users who already have Nix.

Proposed change

  • Add flake.nix using crane for crate vendoring (avoids crates.io 403 from Nix's fetchurl not sending a User-Agent header). Outputs: packages.fslc / .default / .source, apps.fslc / .default, devShells.default, overlays.default, and checks.
  • Pin x86_64-darwin to nixpkgs-26.05-darwin (nixpkgs-unstable 26.11 dropped x86_64-darwin support).
  • Add devbox.json for reproducible development environments (Rust toolchain + cmake + python3 for the vendored Z3 build).
  • Update README install section to include Nix (Flakes) and Devbox instructions.
  • Add .github/workflows/nix.yml for CI validation of the flake.

Branch

feat-nix-package-manager-install on the fork: https://github.com/levonk/fsl/tree/feat-nix-package-manager-install

Verification

  • nix build .#fslc — succeeds
  • ./result/bin/fslc --versionfslc 4.4.1
  • nix run .#default -- --versionfslc 4.4.1
  • fslc-lsp — responds correctly to LSP initialize (hover, completion, definition, references, documentSymbol, codeAction, rename, semanticTokens)
  • nix flake check --all-systems --no-build — all 4 systems evaluate
  • nix develop — devShell works (cargo 1.95.0, cmake 4.1.6, python3 3.13.15)

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