···11+# Copyright 2024, Gavin John <gavinnjohn@gmail.com>
22+# SPDX-License-Identifier: CC0-1.0 OR MIT OR BSL-1.0
33+44+{
55+ inputs = {
66+ # Whenever an upstream change is merged, update this to
77+ # the relevant commit and remove the packages from the
88+ # ...ToUpstream lists below
99+ nixpkgs.url = "github:NixOS/nixpkgs/5e8260003c8ec6c5d6ac6064a2ff901677960412";
1010+ flake-utils.url = "github:numtide/flake-utils";
1111+ };
1212+1313+ outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
1414+ let
1515+ pkgs = nixpkgs.legacyPackages.${system};
1616+1717+ devTools = with pkgs; [
1818+ # Tools that are required in order to develop with Monado, but that are not required to build Monado itself
1919+ # These cannot be upstreamed into nixpkgs, as they are not required to build Monado
2020+ # See https://github.com/NixOS/nix/issues/7501 for a discussion on this
2121+ clang
2222+ cmake-format
2323+ git
2424+ gradle
2525+ gradle-completion
2626+ ];
2727+2828+ nativeBuildInputsToUpstream = with pkgs; [
2929+ # If there are any nativeBuildInputs that are not in nixpkgs, add them here
3030+ # nativeBuildInputs are packages that are needed to develop and/or build the project (i.e. tooling)
3131+ # Once they are upstreamed to nixpkgs master, remove them from this list
3232+ ];
3333+3434+ buildInputsToUpstream = with pkgs; [
3535+ # If there are any buildInputs that are not in nixpkgs, add them here
3636+ # buildInputs are any packages that are needed at runtime (i.e. dependencies)
3737+ # Once they are upstreamed to nixpkgs master, remove them from this list
3838+ xorg.libXext # Open PR: https://github.com/NixOS/nixpkgs/pull/298083
3939+ ];
4040+4141+ package = pkgs.monado.overrideAttrs (oldAttrs: {
4242+ src = ./.;
4343+4444+ nativeBuildInputs = oldAttrs.nativeBuildInputs ++ nativeBuildInputsToUpstream ++ devTools;
4545+ buildInputs = oldAttrs.buildInputs ++ buildInputsToUpstream;
4646+4747+ patches = [];
4848+ });
4949+ in {
5050+ packages.default = package;
5151+ devShells.default = package;
5252+ }
5353+ );
5454+}