2022-01-08 13:03:26 +05:30
|
|
|
{
|
2022-03-13 21:48:46 +05:30
|
|
|
description = "A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once (Fork of MultiMC)";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2023-03-14 15:20:07 +05:30
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2023-03-14 15:23:51 +05:30
|
|
|
pre-commit-hooks = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2023-03-14 15:18:19 +05:30
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
libnbtplusplus = {
|
|
|
|
url = "github:PrismLauncher/libnbtplusplus";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-01-09 00:45:19 +05:30
|
|
|
};
|
2022-01-08 13:03:26 +05:30
|
|
|
|
2023-03-14 15:18:19 +05:30
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2023-03-14 15:20:07 +05:30
|
|
|
flake-utils,
|
2023-03-14 15:23:51 +05:30
|
|
|
pre-commit-hooks,
|
2023-03-14 15:18:19 +05:30
|
|
|
libnbtplusplus,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
# User-friendly version number.
|
|
|
|
version = builtins.substring 0 8 self.lastModifiedDate;
|
2022-03-13 21:48:46 +05:30
|
|
|
|
2023-03-14 15:18:19 +05:30
|
|
|
# Supported systems (qtbase is currently broken for "aarch64-darwin")
|
2023-03-14 15:20:07 +05:30
|
|
|
supportedSystems = with flake-utils.lib.system; [
|
|
|
|
x86_64-linux
|
|
|
|
x86_64-darwin
|
|
|
|
aarch64-linux
|
|
|
|
];
|
2022-03-13 21:48:46 +05:30
|
|
|
|
2023-03-14 15:28:41 +05:30
|
|
|
packagesFn = pkgs: {
|
2023-03-14 15:20:07 +05:30
|
|
|
prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix {
|
|
|
|
inherit version self libnbtplusplus;
|
|
|
|
};
|
|
|
|
prismlauncher = pkgs.qt6Packages.callPackage ./nix {
|
|
|
|
inherit version self libnbtplusplus;
|
|
|
|
};
|
2022-03-13 21:48:46 +05:30
|
|
|
};
|
2023-03-14 15:20:07 +05:30
|
|
|
in
|
|
|
|
flake-utils.lib.eachSystem supportedSystems (system: let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in {
|
2023-03-14 15:23:51 +05:30
|
|
|
checks = {
|
|
|
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
|
|
src = ./.;
|
|
|
|
hooks = {
|
|
|
|
markdownlint.enable = true;
|
2023-03-14 15:29:43 +05:30
|
|
|
|
2023-03-14 15:23:51 +05:30
|
|
|
alejandra.enable = true;
|
2023-03-14 15:29:43 +05:30
|
|
|
deadnix.enable = true;
|
2023-03-14 15:23:51 +05:30
|
|
|
|
|
|
|
clang-format = {
|
|
|
|
enable =
|
|
|
|
false; # As most of the codebase is **not** formatted, we don't want clang-format yet
|
|
|
|
types_or = ["c" "c++"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-03-14 15:20:07 +05:30
|
|
|
packages = let
|
|
|
|
packages = packagesFn pkgs;
|
2023-03-14 15:18:19 +05:30
|
|
|
in
|
2023-03-14 15:20:07 +05:30
|
|
|
packages // {default = packages.prismlauncher;};
|
2023-03-14 15:18:19 +05:30
|
|
|
|
2023-03-14 15:21:47 +05:30
|
|
|
devShells.default = pkgs.mkShell {
|
2023-03-14 15:23:51 +05:30
|
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
|
|
packages = with pkgs; [
|
|
|
|
nodePackages.markdownlint-cli
|
|
|
|
alejandra
|
2023-03-14 15:29:43 +05:30
|
|
|
deadnix
|
2023-03-14 15:23:51 +05:30
|
|
|
clang-tools
|
|
|
|
];
|
|
|
|
|
2023-03-14 15:21:47 +05:30
|
|
|
inputsFrom = [self.packages.${system}.default];
|
|
|
|
buildInputs = with pkgs; [ccache ninja];
|
|
|
|
};
|
2023-03-14 15:28:41 +05:30
|
|
|
})
|
|
|
|
// {
|
|
|
|
overlays.default = final: _: (packagesFn final);
|
|
|
|
};
|
2022-01-08 20:42:44 +05:30
|
|
|
}
|