···3344{
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/e80d1b630036fe33badbc168dfcd071d463b92cf";
1010- flake-utils.url = "github:numtide/flake-utils";
66+ # Whenever an upstream change is merged, update this and
77+ # remove the packages from the ...ToUpstream lists below
88+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
99+ flake-parts.url = "github:hercules-ci/flake-parts";
1110 };
12111313- 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
1212+ outputs =
1313+ inputs@{ nixpkgs, flake-parts, ... }:
1414+ flake-parts.lib.mkFlake { inherit inputs; } {
1515+ systems = [
1616+ "x86_64-linux"
1717+ "aarch64-linux"
1818+ "x86_64-darwin"
1919+ "aarch64-darwin"
2620 ];
2121+ perSystem =
2222+ { pkgs, lib, ... }:
2323+ let
2424+ devTools = with pkgs; [
2525+ # Tools that are required in order to develop with Monado
2626+ # but are not required to build Monado itself
2727+ clang-tools
2828+ cmake-format
2929+ git
3030+ gradle
3131+ gradle-completion
3232+ ];
27332828- 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- ];
3434+ nativeBuildInputsToUpstream = with pkgs; [
3535+ # If there are any nativeBuildInputs that are not in nixpkgs, add them here
3636+ # nativeBuildInputs are packages that are needed to develop and/or build the project (i.e. tooling)
3737+ ];
32383333- buildInputsToUpstream = with pkgs; [
3434- # If there are any buildInputs that are not in nixpkgs, add them here
3535- # buildInputs are any packages that are needed at runtime (i.e. dependencies)
3636- ];
3939+ buildInputsToUpstream = with pkgs; [
4040+ # If there are any buildInputs that are not in nixpkgs, add them here
4141+ # buildInputs are any packages that are needed at runtime (i.e. dependencies)
4242+ ];
37433838- package = pkgs.monado.overrideAttrs (oldAttrs: {
3939- src = ./.;
4444+ package = pkgs.monado.overrideAttrs (oldAttrs: {
4545+ src = ./.;
4646+4747+ nativeBuildInputs = oldAttrs.nativeBuildInputs ++ nativeBuildInputsToUpstream;
4848+ buildInputs = oldAttrs.buildInputs ++ buildInputsToUpstream;
4949+ cmakeFlags = lib.remove "-DXRT_HAVE_STEAM:BOOL=TRUE" oldAttrs.cmakeFlags;
40504141- nativeBuildInputs = oldAttrs.nativeBuildInputs ++ nativeBuildInputsToUpstream ++ devTools;
4242- buildInputs = oldAttrs.buildInputs ++ buildInputsToUpstream;
5151+ patches = [ ];
5252+ });
5353+ in
5454+ {
5555+ packages.default = package;
5656+ devShells.default = package.overrideAttrs (oldAttrs: {
5757+ nativeBuildInputs = oldAttrs.nativeBuildInputs ++ devTools;
5858+ });
43594444- patches = [];
4545- });
4646- in {
4747- packages.default = package;
4848- devShells.default = package;
4949- }
5050- );
6060+ formatter = pkgs.nixfmt-rfc-style;
6161+ };
6262+ };
5163}