|
| 1 | +{ |
| 2 | + description = "Redot Game Engine"; |
| 3 | + |
| 4 | + inputs = { |
| 5 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 6 | + |
| 7 | + flake-utils.url = "github:numtide/flake-utils"; |
| 8 | + }; |
| 9 | + |
| 10 | + outputs = |
| 11 | + { |
| 12 | + self, |
| 13 | + nixpkgs, |
| 14 | + flake-utils, |
| 15 | + }: |
| 16 | + flake-utils.lib.eachDefaultSystem ( |
| 17 | + system: |
| 18 | + let |
| 19 | + pkgs = import nixpkgs { |
| 20 | + inherit system; |
| 21 | + }; |
| 22 | + pkgsCross = import nixpkgs { |
| 23 | + config = { |
| 24 | + crossSystem = "x86_64-w64-mingw32"; |
| 25 | + }; |
| 26 | + |
| 27 | + inherit system; |
| 28 | + }; |
| 29 | + |
| 30 | + mkExportTemplate = pkgs.callPackage (import ./export-template-package.nix) { |
| 31 | + inherit (self.packages.${system}) redot; |
| 32 | + }; |
| 33 | + in |
| 34 | + { |
| 35 | + packages = { |
| 36 | + default = self.packages.${system}.redot; |
| 37 | + |
| 38 | + redot = pkgs.callPackage (import ./package.nix) { |
| 39 | + src = self; |
| 40 | + commitHash = if self ? rev then self.rev else "devel"; |
| 41 | + }; |
| 42 | + |
| 43 | + export-templates-linux-release = mkExportTemplate { |
| 44 | + templateType = "release"; |
| 45 | + platform = "linuxbsd"; |
| 46 | + }; |
| 47 | + |
| 48 | + export-templates-linux-debug = mkExportTemplate { |
| 49 | + templateType = "debug"; |
| 50 | + platform = "linuxbsd"; |
| 51 | + }; |
| 52 | + |
| 53 | + export-templates-windows-release = mkExportTemplate { |
| 54 | + templateType = "release"; |
| 55 | + platform = "windows"; |
| 56 | + }; |
| 57 | + |
| 58 | + export-templates-windows-debug = mkExportTemplate { |
| 59 | + templateType = "debug"; |
| 60 | + platform = "windows"; |
| 61 | + }; |
| 62 | + |
| 63 | + export-templates = pkgs.symlinkJoin { |
| 64 | + name = "redot-export-templates"; |
| 65 | + paths = builtins.attrValues { |
| 66 | + inherit (self.packages.${system}) |
| 67 | + export-templates-linux-release |
| 68 | + export-templates-linux-debug |
| 69 | + export-templates-windows-release |
| 70 | + export-templates-windows-debug |
| 71 | + ; |
| 72 | + }; |
| 73 | + }; |
| 74 | + }; |
| 75 | + |
| 76 | + devShells.default = pkgs.mkShell { |
| 77 | + inherit (self.packages.${system}.redot) nativeBuildInputs; |
| 78 | + |
| 79 | + buildInputs = |
| 80 | + self.packages.${system}.redot.buildInputs ++ self.packages.${system}.redot.runtimeDependencies; |
| 81 | + }; |
| 82 | + } |
| 83 | + ); |
| 84 | +} |
0 commit comments