This repository has been archived by the owner on Jun 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
142 lines (113 loc) · 3.52 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{
description = "wlroots based vr wayland compositor";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
android-nixpkgs = {
url = "github:tadfisher/android-nixpkgs/stable";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, android-nixpkgs, ... }@inputs:
flake-utils.lib.eachSystem
(with flake-utils.lib.system; [
x86_64-linux
])
(system:
let
pkgs = import nixpkgs {
inherit system;
};
aarch64-pkgs = import nixpkgs {
system = "aarch64-linux";
# system = "x86_64-linux";
crossSystem = {
config = "aarch64-unknown-linux-android";
};
};
my-pkgs = import nixpkgs {
inherit system;
overlays = [
(self: super: {
nativeBuildInputs = [ pkgs.zlib ];
buildInputs = [ pkgs.zlib ];
})
];
};
android-sdk = android-nixpkgs.sdk.${system} (sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-29-0-3
platforms-android-29
ndk-21-4-7075529
]);
nativeBuildInputs = with pkgs; [
zig
pkg-config
# libxkbcommon
# pixman
# wayland
wayland-protocols
wayland-scanner
# wlroots
# aarch64-pkgs.libxkbcommon
# aarch64-pkgs.pixman
# aarch64-pkgs.wlroots
# pkgsCross.riscv64.wayland
# pkgsCross.aarch64-android.libffi
# wayland-protocols
# wayland-scanner
android-sdk
jdk11
meson
ninja
expat
libxml2
gnumake
autoconf
automake
libtool
];
buildInputs = with pkgs; [
];
embedded-compositor-host = pkgs.writeShellApplication {
name = "embedded-compositor-host";
runtimeInputs = with pkgs; [ kwin ];
text = ''
kwin_wayland --xwayland --socket wayland-1 --width 1280 --height 720 2> /dev/null
'';
};
packageName = "xrwm";
in
{
packages."xrwm" = pkgs.stdenv.mkDerivation {
pname = "xrwm";
version = "0.0.1";
src = ./.;
nativeBuildInputs = nativeBuildInputs;
buildInputs = buildInputs;
dontInstall = true;
buildPhase = ''
runHook preBuild
# Set Zig global cache directory
export XDG_CACHE_HOME="$TMPDIR/zig-cache/"
zig build install --prefix $out
runHook postBuild
'';
};
devShells.dev = pkgs.mkShell {
packages = with pkgs; [
rnix-lsp
zls
embedded-compositor-host
] ++ nativeBuildInputs ++ buildInputs;
shellHook = ''
[ $STARSHIP_SHELL ] && exec $STARSHIP_SHELL
'';
# AARCH_LIBC = "${aarch64-pkgs.glibc}/lib";
CURRENT_PROJECT = packageName;
};
defaultPackage = self.packages.${system}.${packageName};
devShell = self.devShells.${system}.dev;
});
}