forked from maximoffua/flutter.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
61 lines (56 loc) · 1.55 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
description = "Flutter SDK in a Nix flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ {flake-parts, nixpkgs, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
imports = [
flake-parts.flakeModules.easyOverlay
];
perSystem = {
config,
self',
inputs',
pkgs,
system,
lib,
...
}: let
ownPkgs = import ./pkgs {inherit pkgs lib;};
mkApp = name: let pkg = self'.packages.${name}; in {
type = "app";
program = "${pkg}/bin/${name}";
};
in {
overlayAttrs = {
inherit (ownPkgs) dart flutter
buildDartApplication buildFlutterApplication pub2nix dartHooks;
};
packages = {
inherit (ownPkgs) flutter dart flutter-unwrapped;
default = ownPkgs.flutter;
};
apps = rec {
flutter = mkApp "flutter";
dart = mkApp "dart";
default = flutter;
};
checks.test = pkgs.stdenvNoCC.mkDerivation {
name = "flutter-doctor";
src = ./.;
nativeBuildInputs = [self'.packages.flutter];
dontBuild = true;
installPhase = ''
mkdir $out
'';
checkPhase = ''
flutter doctor
'';
};
};
flake = {};
};
}