This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathflake.nix
82 lines (76 loc) · 1.84 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
{
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
'';
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
(pkgs.python311Full.withPackages (pip: [
pip.pyaml
]))
];
};
};
flake = {};
};
}