Skip to content

[Backend] Nix Package Manager Implementation #81

@yashksaini-coder

Description

@yashksaini-coder

Goal

Support declarative Nix package management from TRX.

Description

Implement the PackageManager trait in src/managers/nix.rs for the Nix package manager.

Key challenges unique to Nix:

  • Profiles: Packages can be in the system profile or user profile; handle both
  • Package naming: Nix uses attribute paths (e.g., nixpkgs.git) rather than simple names
  • Immutability: Nix doesn't "remove" packages traditionally — it updates the profile
  • Search: Use nix search nixpkgs <query> (Nix 2.x) and parse JSON output (--json)

Required methods:

  • search(query)nix search nixpkgs <query> --json
  • get_installed()nix profile list or nix-env -q
  • install()nix profile install nixpkgs#<pkg>
  • remove()nix profile remove <pkg>
  • system_upgrade()nix profile upgrade '.*'

Tech

Rust, Nix CLI, JSON parsing

Difficulty

Level 3 – Advanced

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions