-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
96 lines (88 loc) · 2.15 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
description = "flutter-nix";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
nix-filter.url = "github:ilkecan/nix-filter";
android-nixpkgs = {
url = "github:tadfisher/android-nixpkgs/stable";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
inherit (inputs.flake-utils.lib)
eachSystem
;
supportedSystems = [
"x86_64-linux"
];
privateOverlay = final: prev:
let
inherit (prev)
callPackage
;
in
{
nix-filter = inputs.nix-filter.lib;
flutter-nix = prev.flutter-nix // {
internal = {
sdk-dependencies =
callPackage ./nix/flutter/sdk-dependencies.nix { };
};
};
};
in
{
inherit supportedSystems;
overlay = final: prev:
let
pkgs = prev.appendOverlays [
(import ./nix/haskell)
inputs.android-nixpkgs.overlay
privateOverlay
];
inherit (pkgs)
callPackage
haskellPackages
;
in
{
flutter-nix = {
buildFlutterApp = callPackage ./nix/flutter/build-flutter-app { };
mkShell = callPackage ./nix/flutter/mk-shell.nix { };
translator = haskellPackages.flutter-nix-translator;
supportedPlatforms = [
"linux"
"web"
];
};
};
} // eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlay
privateOverlay
];
};
inherit (pkgs)
callPackage
flutter-nix
;
in
rec {
packages = {
inherit (flutter-nix)
translator
;
};
defaultPackage = packages.translator;
devShell = callPackage ./nix/dev-shell.nix { };
}
);
}