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 · 2 comments
Open

[Feature Request] Nix package #811

AdrienLemaire opened this issue Jan 9, 2025 · 2 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
@Jonas-Sander
Copy link

Just to add some context:
This is useful because using the flutter packages from nixpkgs (the nix "native" way) is very hit-or-miss. There are some specific bugs and only a handful of stable versions are available. Also it often lags behind the latest release(s).
FVM would enable to just install flutter there like everywhere else.
Binaries need to be packaged like this to easily use them for Nix.

If the dev is not familiar with nix and/or this is not very probable to be implemented here, then making a packaging request in the nixpkgs GitHub repo might be more useful @AdrienLemaire .

@Jonas-Sander
Copy link

I see there is already an request: NixOS/nixpkgs#186998

Please give a thumbs up there

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

2 participants