Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Nix package #811

Open
AdrienLemaire opened this issue Jan 9, 2025 · 0 comments
Open

[Feature Request] Nix package #811

AdrienLemaire opened this issue Jan 9, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@AdrienLemaire
Copy link

Is your feature request related to a problem? Please describe.
For Nix and NixOS users, a nix package is necessary for installation

Describe the solution you'd like
Following nixpkgs conventions, we should create a file package.nix.
Here's a template to get started with:

{ lib
, stdenv
, fetchFromGitHub
}:

stdenv.mkDerivation rec {
  pname = "fvm";
  version = "3.2.1";

  src = fetchFromGitHub {
    owner  = "leoafarias";
    repo   = "fvm";
    rev    = "v${version}";
    sha256 = "06ywxznch1r9fb6598i632rz207vw3ncg9g1yabarrnj3920kfwb";
  };

  phases = [ "installPhase" ];
  installPhase = ''
    mkdir -p $out/bin
    # If we fetched a single binary named fvm:
    cp fvm-${version} $out/bin/fvm
    chmod +x $out/bin/fvm
  '';

  meta = with lib; {
    description = "Flutter Version Management: CLI to manage multiple Flutter SDK versions";
    homepage    = "https://github.com/leoafarias/fvm";
    license     = licenses.mit;
    maintainers = [ maintainers.yourName ];
    platforms   = platforms.all;
  };
}

Describe alternatives you've considered
I was considering creating the nix package myself, but being a new nixos user, I lack experience with it. Since fvm has a lot of pre-built packages for different platforms, I'm not sure what would be the best way to support them all in nix.

Additional context
Similar packages such as volta have their nix package and could be used as reference.

@AdrienLemaire AdrienLemaire added the enhancement New feature or request label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant