sneedmc/flake.nix

46 lines
2.0 KiB
Nix
Raw Normal View History

2022-01-08 07:33:26 +00:00
{
description = "A sneedful launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once (Fork of MultiMC)";
2022-03-13 16:18:46 +00:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
libnbtplusplus = { url = "github:PolyMC/libnbtplusplus"; flake = false; };
tomlplusplus = { url = "github:marzer/tomlplusplus"; flake = false; };
2022-01-08 19:15:19 +00:00
};
2022-01-08 07:33:26 +00:00
outputs = { self, nixpkgs, libnbtplusplus, tomlplusplus, ... }:
let
# User-friendly version number.
2022-03-13 16:18:46 +00:00
version = builtins.substring 0 8 self.lastModifiedDate;
# Supported systems (qtbase is currently broken for "aarch64-darwin")
2022-03-13 16:18:46 +00:00
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported systems.
2022-03-13 16:18:46 +00:00
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
packagesFn = pkgs: rec {
polymc = pkgs.libsForQt5.callPackage ./nix { inherit version self libnbtplusplus tomlplusplus; };
polymc-qt6 = pkgs.qt6Packages.callPackage ./nix { inherit version self libnbtplusplus tomlplusplus; };
};
2022-03-13 16:18:46 +00:00
in
{
packages = forAllSystems (system: rec {
sneedmc = pkgs.${system}.libsForQt5.callPackage ./nix { inherit version self libnbtplusplus; };
sneedmc-qt6 = pkgs.${system}.qt6Packages.callPackage ./nix { inherit version self libnbtplusplus; };
2022-03-13 16:18:46 +00:00
default = sneedmc;
2022-01-13 13:28:45 +00:00
});
2022-05-27 19:42:23 +00:00
defaultPackage = forAllSystems (system: self.packages.${system}.default);
2022-03-13 16:18:46 +00:00
apps = forAllSystems (system: rec { sneedmc = { type = "app"; program = "${self.defaultPackage.${system}}/bin/sneedmc"; }; default = sneedmc; });
defaultApp = forAllSystems (system: self.apps.${system}.default);
2022-03-13 16:18:46 +00:00
overlay = final: prev: { sneedmc = self.defaultPackage.${final.system}; };
2022-03-13 16:18:46 +00:00
};
}