-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
102 lines (92 loc) · 3.16 KB
/
flake.nix
File metadata and controls
102 lines (92 loc) · 3.16 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
{
description = "Android Manager based on Nix";
# nixConfig = {
# trusted-substituters = [
# "https://nix-on-droid.cachix.org"
# ];
# trusted-public-keys = [
# "nix-on-droid.cachix.org-1:56snoMJTXmDRC1Ei24CmKoUqvHJ9XCp+nidK7qkMQrU="
# ];
# };
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-bundle = {
url = "github:nix-community/nix-bundle";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:nix-community/nix-on-droid";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.nixpkgs-for-bootstrap.follows = "nixpkgs";
};
pkgs-by-name-for-flake-parts.url = "github:drupol/pkgs-by-name-for-flake-parts";
android-nixpkgs = {
url = "github:tadfisher/android-nixpkgs";
# The main branch follows the "canary" channel of the Android SDK
# repository. Use another android-nixpkgs branch to explicitly
# track an SDK release channel.
#
# url = "github:tadfisher/android-nixpkgs/stable";
# url = "github:tadfisher/android-nixpkgs/beta";
# url = "github:tadfisher/android-nixpkgs/preview";
# url = "github:tadfisher/android-nixpkgs/canary";
# If you have nixpkgs as an input, this will replace the "nixpkgs" input
# for the "android" flake.
#
inputs.nixpkgs.follows = "nixpkgs";
};
make-wrapper = {
url = "github:polygon/make-wrapper";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, flake-parts, nixpkgs, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.pkgs-by-name-for-flake-parts.flakeModule
./apks
./bundlers
./flake-modules
./lib.nix
];
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
pkgsDirectory = ./pkgs;
};
flake = {
# The usual flake attributes can be defined here, including system-
# agnostic ones like nixosModule and system-enumerating ones, although
# those are more easily expressed in perSystem.
droidManagerConfigurations.example = self.lib.droidManagerConfiguration {
deviceSystem = "aarch64-linux";
isRooted = false;
modules = [
(
{ pkgs, apks, ... }:
{
apps = {
f-droid.enable = true;
kvaesitso.enable = true;
};
environment.files.root."/tmp/test" = {
content = "test";
};
environment.files.root."/tmp/test-root" = {
content = "test-root";
needsRoot = true;
};
build.activation.device.default = {
hello-world.script = "echo hello world";
hello-world-root = {
script = "echo hello rooted world";
needsRoot = true;
};
};
}
)
];
};
};
};
}