The open source OpenXR runtime
1# Copyright 2024, Gavin John <gavinnjohn@gmail.com>
2# SPDX-License-Identifier: CC0-1.0 OR MIT OR BSL-1.0
3
4{
5 inputs = {
6 # Whenever an upstream change is merged, update this and
7 # remove the packages from the ...ToUpstream lists below
8 nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
9 flake-parts.url = "github:hercules-ci/flake-parts";
10 };
11
12 outputs =
13 inputs@{ nixpkgs, flake-parts, ... }:
14 flake-parts.lib.mkFlake { inherit inputs; } {
15 systems = [
16 "x86_64-linux"
17 "aarch64-linux"
18 "x86_64-darwin"
19 "aarch64-darwin"
20 ];
21 perSystem =
22 { pkgs, lib, ... }:
23 let
24 devTools = with pkgs; [
25 # Tools that are required in order to develop with Monado
26 # but are not required to build Monado itself
27 clang-tools
28 cmake-format
29 git
30 gradle
31 gradle-completion
32 ];
33
34 nativeBuildInputsToUpstream = with pkgs; [
35 # If there are any nativeBuildInputs that are not in nixpkgs, add them here
36 # nativeBuildInputs are packages that are needed to develop and/or build the project (i.e. tooling)
37 ];
38
39 buildInputsToUpstream = with pkgs; [
40 # If there are any buildInputs that are not in nixpkgs, add them here
41 # buildInputs are any packages that are needed at runtime (i.e. dependencies)
42 ];
43
44 package = pkgs.monado.overrideAttrs (oldAttrs: {
45 src = ./.;
46
47 nativeBuildInputs = oldAttrs.nativeBuildInputs ++ nativeBuildInputsToUpstream;
48 buildInputs = oldAttrs.buildInputs ++ buildInputsToUpstream;
49 cmakeFlags = lib.remove "-DXRT_HAVE_STEAM:BOOL=TRUE" oldAttrs.cmakeFlags;
50
51 patches = [ ];
52 });
53 in
54 {
55 packages.default = package;
56 devShells.default = package.overrideAttrs (oldAttrs: {
57 nativeBuildInputs = oldAttrs.nativeBuildInputs ++ devTools;
58 });
59
60 formatter = pkgs.nixfmt-rfc-style;
61 };
62 };
63}