-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflake.nix
More file actions
118 lines (102 loc) · 2.7 KB
/
flake.nix
File metadata and controls
118 lines (102 loc) · 2.7 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
description = "Task management tool that synchronizes with git.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
# inputs for following
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs = {};
};
};
outputs = {
self,
nixpkgs,
flake-utils,
treefmt-nix,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
unfreePkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};
android = unfreePkgs.androidenv.composeAndroidPackages {
cmdLineToolsVersion = "11.0";
};
nightly = false;
rust =
if nightly
then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)
else pkgs.rust-bin.stable.latest.default;
treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
cli = pkgs.callPackage ./packages/cli.nix {};
frb = pkgs.callPackage ./packages/flutter_rust_bridge.nix {};
tests = import ./tests/tests.nix {
inherit pkgs;
inherit (pkgs) lib;
specialArgs = {
stride-cli = cli;
nixos-lib = import (nixpkgs + "/nixos/lib") {};
};
};
in {
packages = {
inherit cli frb;
};
checks =
{
inherit cli;
formatting = treefmtEval.config.build.check self;
}
// tests;
formatter = treefmtEval.config.build.wrapper;
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
# Required for building the `openssl-sys` crate, as this uses `perl` to configure
# `openssl`.
pkgs.perl
];
buildInputs = [
# Needed for `taskchampion`
pkgs.sqlite
];
env = {
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
JAVA_HOME = pkgs.jdk17;
ANDROID_AVD_HOME = (builtins.toString ./.) + "/.android/avd";
};
packages = [
rust
frb
pkgs.cargo-edit
pkgs.flutter
pkgs.jdk17
android.platform-tools
];
};
});
}
# vim: ts=2