-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (57 loc) · 1.88 KB
/
flake.nix
File metadata and controls
63 lines (57 loc) · 1.88 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
{
description = "Lightway flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
imports = [
inputs.treefmt-nix.flakeModule
./nix/modules/common.nix
./nix/modules/native.nix
./nix/modules/cross.nix
./nix/modules/devshells.nix
./nix/modules/checks.nix
];
perSystem =
{
config,
pkgs,
system,
nativeSuffix,
...
}:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.rust-overlay.overlays.default ];
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};
# Convenience aliases for native packages
packages = {
default = config.packages."lightway-client-${nativeSuffix}";
lightway-client = config.packages."lightway-client-${nativeSuffix}";
lightway-server = config.packages."lightway-server-${nativeSuffix}";
lightway-client-msrv = config.packages."lightway-client-${nativeSuffix}-msrv";
lightway-server-msrv = config.packages."lightway-server-${nativeSuffix}-msrv";
};
treefmt = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt.compiler;
programs.nixfmt.package = pkgs.nixfmt;
};
};
};
}