The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: Add flake files for Nix development

authored by

Gavin John and committed by
Simon Zeni
84b3ed90 88317246

+115
+61
flake.lock
··· 1 + { 2 + "nodes": { 3 + "flake-utils": { 4 + "inputs": { 5 + "systems": "systems" 6 + }, 7 + "locked": { 8 + "lastModified": 1710146030, 9 + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", 10 + "owner": "numtide", 11 + "repo": "flake-utils", 12 + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", 13 + "type": "github" 14 + }, 15 + "original": { 16 + "owner": "numtide", 17 + "repo": "flake-utils", 18 + "type": "github" 19 + } 20 + }, 21 + "nixpkgs": { 22 + "locked": { 23 + "lastModified": 1709328908, 24 + "narHash": "sha256-Uc9MPjHn/E1n2exlKCuy2WWVJsb4nFuzK/G7MzoJQlQ=", 25 + "owner": "NixOS", 26 + "repo": "nixpkgs", 27 + "rev": "5e8260003c8ec6c5d6ac6064a2ff901677960412", 28 + "type": "github" 29 + }, 30 + "original": { 31 + "owner": "NixOS", 32 + "repo": "nixpkgs", 33 + "rev": "5e8260003c8ec6c5d6ac6064a2ff901677960412", 34 + "type": "github" 35 + } 36 + }, 37 + "root": { 38 + "inputs": { 39 + "flake-utils": "flake-utils", 40 + "nixpkgs": "nixpkgs" 41 + } 42 + }, 43 + "systems": { 44 + "locked": { 45 + "lastModified": 1681028828, 46 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 47 + "owner": "nix-systems", 48 + "repo": "default", 49 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 50 + "type": "github" 51 + }, 52 + "original": { 53 + "owner": "nix-systems", 54 + "repo": "default", 55 + "type": "github" 56 + } 57 + } 58 + }, 59 + "root": "root", 60 + "version": 7 61 + }
+54
flake.nix
··· 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 to 7 + # the relevant commit and remove the packages from the 8 + # ...ToUpstream lists below 9 + nixpkgs.url = "github:NixOS/nixpkgs/5e8260003c8ec6c5d6ac6064a2ff901677960412"; 10 + flake-utils.url = "github:numtide/flake-utils"; 11 + }; 12 + 13 + outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: 14 + let 15 + pkgs = nixpkgs.legacyPackages.${system}; 16 + 17 + devTools = with pkgs; [ 18 + # Tools that are required in order to develop with Monado, but that are not required to build Monado itself 19 + # These cannot be upstreamed into nixpkgs, as they are not required to build Monado 20 + # See https://github.com/NixOS/nix/issues/7501 for a discussion on this 21 + clang 22 + cmake-format 23 + git 24 + gradle 25 + gradle-completion 26 + ]; 27 + 28 + nativeBuildInputsToUpstream = with pkgs; [ 29 + # If there are any nativeBuildInputs that are not in nixpkgs, add them here 30 + # nativeBuildInputs are packages that are needed to develop and/or build the project (i.e. tooling) 31 + # Once they are upstreamed to nixpkgs master, remove them from this list 32 + ]; 33 + 34 + buildInputsToUpstream = with pkgs; [ 35 + # If there are any buildInputs that are not in nixpkgs, add them here 36 + # buildInputs are any packages that are needed at runtime (i.e. dependencies) 37 + # Once they are upstreamed to nixpkgs master, remove them from this list 38 + xorg.libXext # Open PR: https://github.com/NixOS/nixpkgs/pull/298083 39 + ]; 40 + 41 + package = pkgs.monado.overrideAttrs (oldAttrs: { 42 + src = ./.; 43 + 44 + nativeBuildInputs = oldAttrs.nativeBuildInputs ++ nativeBuildInputsToUpstream ++ devTools; 45 + buildInputs = oldAttrs.buildInputs ++ buildInputsToUpstream; 46 + 47 + patches = []; 48 + }); 49 + in { 50 + packages.default = package; 51 + devShells.default = package; 52 + } 53 + ); 54 + }