use flakes shell

pull/110/head
Alya Sirko 2022-09-02 20:28:14 +03:00
parent 7cdc8c9eb1
commit c5970afe5b
3 changed files with 48 additions and 15 deletions

26
flake.lock Normal file
View File

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs-unstable": {
"locked": {
"lastModified": 1662019588,
"narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2da64a81275b68fdad38af669afeda43d401e94b",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs-unstable": "nixpkgs-unstable"
}
}
},
"root": "root",
"version": 7
}

22
flake.nix Normal file
View File

@ -0,0 +1,22 @@
{
inputs.nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs-unstable }:
let
pkgs = import nixpkgs-unstable { config.allowUnfree = true; config.android_sdk.accept_license = true; };
androidComposition = pkgs.androidenv.composeAndroidPackages {
toolsVersion = "26.1.1";
platformToolsVersion = "33.0.2";
buildToolsVersions = [ "30.0.3" ];
platformVersions = [ "31" "30" "29" ];
};
in {
devShell.x86_64-linux = pkgs.mkShell {
JAVA_HOME = "${pkgs.openjdk11_headless.home}";
ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk";
ANDROID_SDK_ROOT = "${androidComposition.androidsdk}/libexec/android-sdk";
buildInputs = with pkgs; [ bash git androidComposition.androidsdk flutter openjdk11_headless ];
};
};
}

View File

@ -1,15 +0,0 @@
{ pkgs ? import <unstable> { config.android_sdk.accept_license = true; } }:
let
androidComposition = pkgs.androidenv.composeAndroidPackages {
toolsVersion = "26.1.1";
platformToolsVersion = "33.0.2";
buildToolsVersions = [ "30.0.3" ];
platformVersions = [ "31" "30" "29" ];
};
in
pkgs.mkShell {
ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk";
ANDROID_SDK_ROOT = "${androidComposition.androidsdk}/libexec/android-sdk";
nativeBuildInputs = with pkgs; [ flutter openjdk11_headless ];
}