diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..451249d73 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + inputs = { + uninix.url = "github:pauliesnug/uninix"; + flake-utils.follows = "uninix/flake-utils"; + nixpkgs.follows = "uninix/nixpkgs"; + }; + + outputs = inputs: with inputs; + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ uninix.overlays.gradle ]; + }; + + pkgSystem = pkgs.builder.gradle.makePackageSet { + packageFn = import ./uni.demo.nix; + targets = "auto"; + }; + in rec { + packages = { + oneconfig = (pkgSystem.workspace.minecraft.eachDefaultVersion {}).bin; + default = packages.oneconfig; + }; + } + ); +} \ No newline at end of file diff --git a/uni.demo.nix b/uni.demo.nix new file mode 100644 index 000000000..a17954188 --- /dev/null +++ b/uni.demo.nix @@ -0,0 +1,37 @@ +# This DEMO file was @generated by uninix alpha-1 +# IT is not intended to be used in production or manually edited. +# This is a basic demo file intended to be a placeholder until +# the official uni.adapt.nix file is able to be configured. + +args@{ + release ? true, + uninixLib, + target ? null, + lib, + workspaceSource, + gradle, + compileMode ? null, + gradlePackages, + workspaceGen, +}: +let + workspaceSource = if args.workspaceSource == null then ./. else args.workspaceSource; +in let + inherit (uninixLib) genDrvsByVersion decideVersion; + inherit (gradle) makeGradlePkg fetchGradle; + versionsBySettings = {}; + overridableMakeGradlePkg = f: + let + drvs = genDrvsByVersion versionsBySettings ({ version, versionName }: makeGradlePkg ({ inherit release version target; } // (f versionName))); + in { compileMode ? null, versionName ? decideVersion compileMode release }: + let drv = drvs.${versionName}; in if compileMode == null then drv else drv.override { inherit compileMode; }; +in +{ + uninixVersion = "alpha-1"; + workspace = workspaceGen; + "unknown".workspace.version = overridableMakeGradlePkg (versionName: { + name = workspaceGen.minecraft.sort.name; + version = workspaceGen.minecraft.sort.version; + src = fetchGradle workspaceSource; + }); +} \ No newline at end of file