nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildDartApplication,
4 fetchFromGitHub,
5 runCommand,
6 yq-go,
7 _experimental-update-script-combinators,
8 nix-update-script,
9}:
10
11let
12 version = "4.0.5";
13
14 src = fetchFromGitHub {
15 owner = "leoafarias";
16 repo = "fvm";
17 tag = version;
18 hash = "sha256-NLFEGUo4Zy/OYOlbPKirN+JhbGfvzX2Eg0qB10SiGxs=";
19 };
20in
21buildDartApplication {
22 pname = "fvm";
23 inherit version src;
24
25 pubspecLock = lib.importJSON ./pubspec.lock.json;
26
27 passthru = {
28 pubspecSource =
29 runCommand "pubspec.lock.json"
30 {
31 inherit src;
32 nativeBuildInputs = [ yq-go ];
33 }
34 ''
35 yq eval --output-format=json --prettyPrint $src/pubspec.lock > "$out"
36 '';
37 updateScript = _experimental-update-script-combinators.sequence [
38 (nix-update-script { })
39 (
40 (_experimental-update-script-combinators.copyAttrOutputToFile "fvm.pubspecSource" ./pubspec.lock.json)
41 // {
42 supportedFeatures = [ ];
43 }
44 )
45 ];
46 };
47
48 meta = {
49 description = "Simple CLI to manage Flutter SDK versions";
50 homepage = "https://github.com/leoafarias/fvm";
51 license = lib.licenses.mit;
52 mainProgram = "fvm";
53 maintainers = [ ];
54 };
55}