Git Product home page Git Product logo

flutter.nix's Introduction

FlakeHub

Flutter SDK for Nix

This repository is made for fixing issues with flutter in nixpkgs, specifically #260278.

Getting started

This flake provides the following packages:

  • packages.${system}.flutter
  • packages.${system}.dart

and an overlay:

  • overlays.default

With flakes

Add this flake as an input and either use:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    flutter-nix.url = "github:maximoffua/flutter.nix/stable"; # remove `/stable` to use main branch
          # stable can be replaced with specific tag matching Flutter versions, e.g. 3.16.7
  };
 
  outputs = { self, flutter-nix }:
  let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system;
      # add overlay from flutter-nix, which replaces dart and flutter packages
      overlays = [
        flutter.nix.overlays.default
      ];
    };
  in {
    # Use flutter-nix in your outputs or use `pkgs`,
    # which is nixpkgs for the system, with flutter.nix's overlay applied.

    packages.flutter = flutter-nix.packages.${system}.flutter;
  };
}

See #1 for more examples of usage with flakes.

With devenv and overlays

# devenv.yaml
inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
  flutter-nix:
    url: github:maximoffua/flutter.nix/stable
    overlays:
      - default
# devenv.nix
{
  pkgs,
  inputs,
  ...
}: {
  languages.dart.enable = true;
  languages.dart.package = pkgs.flutter;

  enterShell = ''
    flutter --version
  '';
}

With devenv

If you have issues with overlay, just use package directly from this flake:

# devenv.yaml
inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
  flutter-nix:
    url: github:maximoffua/flutter.nix/stable
# devenv.nix
{
  pkgs,
  inputs,
  ...
}: let
  system = pkgs.stdenv.system;
  flutter = inputs.flutter-nix.packages.${system}.flutter;
in {
  languages.dart.enable = true;
  languages.dart.package = flutter;

  enterShell = ''
    flutter --version
  '';
}

Update version

There is a Python script which will obtain the latest Flutter version, fetch info and update hash sums.

./update/update.py

Contributors

Big thanks:

flutter.nix's People

Contributors

maximoffua avatar brokenpylons avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.