Skip to content

.nix files are automatically recognized as json format. #683

@joyanhui

Description

@joyanhui

Description

.nix file like

{
  description = "moxlib";
  inputs = {
    nixpkgs.url = "https://mirrors.ustc.edu.cn/nix-channels/nixos-24.11/nixexprs.tar.xz";
    flake-utils.url = "github:numtide/flake-utils";
    android-nixpkgs.url = "github:tadfisher/android-nixpkgs";
  };

  outputs = { self, nixpkgs, flake-utils, android-nixpkgs }: flake-utils.lib.eachDefaultSystem (system: let
    pkgs = import nixpkgs {
      inherit system;
      config = {
        android_sdk.accept_license = true;
        allowUnfree = true;

        # Fix to allow building the NDK package
        # TODO: Remove once https://github.com/tadfisher/android-nixpkgs/issues/62 is resolved
        permittedInsecurePackages = [
          "python-2.7.18.6"
        ];
      };
    };
 
    pinnedJDK = pkgs.jdk17;
    pinnedflutter = pkgs.flutter327;
  in {
    devShell = pkgs.mkShell {
      buildInputs = with pkgs; [
        pinnedflutter
        pinnedJDK 

        android-studio
        
	      gitlint jq # Code hygiene
	      ripgrep # General utilities

        # Flutter dependencies for linux desktop
        atk
        cairo
        clang
        cmake
        libepoxy
        gdk-pixbuf
        glib
        gtk3
        harfbuzz
        ninja
        pango
        pcre
        pkg-config
        xorg.libX11
        xorg.xorgproto
      ];

      # Make Flutter build on desktop
      CPATH = "${pkgs.xorg.libX11.dev}/include:${pkgs.xorg.xorgproto}/include";
      LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ atk cairo libepoxy gdk-pixbuf glib gtk3 harfbuzz pango ];
      ANDROID_SDK_ROOT = "/home/yh/android_flutter/android-sdk";
      ANDROID_HOME = "/home/yh/android_flutter/android-sdk";
      JAVA_HOME = pinnedJDK;

              MY_ANDROID_STUDIO_DIR = "${pkgs.android-studio}";   #    flutter config --android-studio-dir $MY_ANDROID_STUDIO_DIR


      # Fix an issue with Flutter using an older version of aapt2, which does not know
      # an used parameter.
      GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=/home/yh/android_flutter/android-sdk/build-tools/34.0.0/aapt2";
    };
  });
}

Describe the solution you'd like

It is recommended to use Makefile format for highlighting, or customize the highlighting of .nix files

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions