chore(nix): format code using alejandra
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
e0e26a37b5
commit
9dff1bac83
59
flake.nix
59
flake.nix
@ -3,35 +3,46 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
flake-compat = {
|
||||||
libnbtplusplus = { url = "github:PrismLauncher/libnbtplusplus"; flake = false; };
|
url = "github:edolstra/flake-compat";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
libnbtplusplus = {
|
||||||
|
url = "github:PrismLauncher/libnbtplusplus";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, libnbtplusplus, ... }:
|
outputs = {
|
||||||
let
|
self,
|
||||||
# User-friendly version number.
|
nixpkgs,
|
||||||
version = builtins.substring 0 8 self.lastModifiedDate;
|
libnbtplusplus,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
# User-friendly version number.
|
||||||
|
version = builtins.substring 0 8 self.lastModifiedDate;
|
||||||
|
|
||||||
# Supported systems (qtbase is currently broken for "aarch64-darwin")
|
# Supported systems (qtbase is currently broken for "aarch64-darwin")
|
||||||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
|
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux"];
|
||||||
|
|
||||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
|
||||||
# Nixpkgs instantiated for supported systems.
|
# Nixpkgs instantiated for supported systems.
|
||||||
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
||||||
|
|
||||||
packagesFn = pkgs: rec {
|
packagesFn = pkgs: rec {
|
||||||
prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix { inherit version self libnbtplusplus; };
|
prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix {inherit version self libnbtplusplus;};
|
||||||
prismlauncher = pkgs.qt6Packages.callPackage ./nix { inherit version self libnbtplusplus; };
|
prismlauncher = pkgs.qt6Packages.callPackage ./nix {inherit version self libnbtplusplus;};
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
packages = forAllSystems (system:
|
|
||||||
let packages = packagesFn pkgs.${system}; in
|
|
||||||
packages // { default = packages.prismlauncher; }
|
|
||||||
);
|
|
||||||
|
|
||||||
overlay = final: packagesFn;
|
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
packages = forAllSystems (
|
||||||
|
system: let
|
||||||
|
packages = packagesFn pkgs.${system};
|
||||||
|
in
|
||||||
|
packages // {default = packages.prismlauncher;}
|
||||||
|
);
|
||||||
|
|
||||||
|
overlay = final: packagesFn;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
129
nix/default.nix
129
nix/default.nix
@ -1,52 +1,54 @@
|
|||||||
{ lib
|
{
|
||||||
, stdenv
|
lib,
|
||||||
, cmake
|
stdenv,
|
||||||
, jdk8
|
cmake,
|
||||||
, jdk17
|
jdk8,
|
||||||
, zlib
|
jdk17,
|
||||||
, file
|
zlib,
|
||||||
, wrapQtAppsHook
|
file,
|
||||||
, xorg
|
wrapQtAppsHook,
|
||||||
, libpulseaudio
|
xorg,
|
||||||
, qtbase
|
libpulseaudio,
|
||||||
, qtsvg
|
qtbase,
|
||||||
, qtwayland
|
qtsvg,
|
||||||
, libGL
|
qtwayland,
|
||||||
, quazip
|
libGL,
|
||||||
, glfw
|
quazip,
|
||||||
, openal
|
glfw,
|
||||||
, extra-cmake-modules
|
openal,
|
||||||
, tomlplusplus
|
extra-cmake-modules,
|
||||||
, ghc_filesystem
|
tomlplusplus,
|
||||||
, cmark
|
ghc_filesystem,
|
||||||
, msaClientID ? ""
|
cmark,
|
||||||
, jdks ? [ jdk17 jdk8 ]
|
msaClientID ? "",
|
||||||
|
jdks ? [jdk17 jdk8],
|
||||||
# flake
|
# flake
|
||||||
, self
|
self,
|
||||||
, version
|
version,
|
||||||
, libnbtplusplus
|
libnbtplusplus,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "prismlauncher";
|
pname = "prismlauncher";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
src = lib.cleanSource self;
|
src = lib.cleanSource self;
|
||||||
|
|
||||||
nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 wrapQtAppsHook ];
|
nativeBuildInputs = [extra-cmake-modules cmake file jdk17 wrapQtAppsHook];
|
||||||
buildInputs = [
|
buildInputs =
|
||||||
qtbase
|
[
|
||||||
qtsvg
|
qtbase
|
||||||
zlib
|
qtsvg
|
||||||
quazip
|
zlib
|
||||||
ghc_filesystem
|
quazip
|
||||||
tomlplusplus
|
ghc_filesystem
|
||||||
cmark
|
tomlplusplus
|
||||||
] ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland;
|
cmark
|
||||||
|
]
|
||||||
|
++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland;
|
||||||
|
|
||||||
cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]
|
cmakeFlags =
|
||||||
++ lib.optionals (lib.versionOlder qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=5" ];
|
lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"]
|
||||||
|
++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"];
|
||||||
dontWrapQtApps = true;
|
dontWrapQtApps = true;
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
@ -57,30 +59,27 @@ stdenv.mkDerivation rec {
|
|||||||
chown -R $USER: source/libraries/libnbtplusplus
|
chown -R $USER: source/libraries/libnbtplusplus
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall =
|
postInstall = let
|
||||||
let
|
libpath = with xorg;
|
||||||
libpath = with xorg;
|
lib.makeLibraryPath [
|
||||||
lib.makeLibraryPath [
|
libX11
|
||||||
libX11
|
libXext
|
||||||
libXext
|
libXcursor
|
||||||
libXcursor
|
libXrandr
|
||||||
libXrandr
|
libXxf86vm
|
||||||
libXxf86vm
|
libpulseaudio
|
||||||
libpulseaudio
|
libGL
|
||||||
libGL
|
glfw
|
||||||
glfw
|
openal
|
||||||
openal
|
stdenv.cc.cc.lib
|
||||||
stdenv.cc.cc.lib
|
];
|
||||||
];
|
in ''
|
||||||
in
|
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
||||||
''
|
wrapQtApp $out/bin/prismlauncher \
|
||||||
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
|
||||||
wrapQtApp $out/bin/prismlauncher \
|
--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \
|
||||||
--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
|
--prefix PATH : ${lib.makeBinPath [xorg.xrandr]}
|
||||||
--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \
|
'';
|
||||||
--prefix PATH : ${lib.makeBinPath [xorg.xrandr]}
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://prismlauncher.org/";
|
homepage = "https://prismlauncher.org/";
|
||||||
@ -93,6 +92,6 @@ stdenv.mkDerivation rec {
|
|||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${version}";
|
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${version}";
|
||||||
license = licenses.gpl3Only;
|
license = licenses.gpl3Only;
|
||||||
maintainers = with maintainers; [ minion3665 Scrumplex ];
|
maintainers = with maintainers; [minion3665 Scrumplex];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@ let
|
|||||||
sha256 = narHash;
|
sha256 = narHash;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
import flake-compat { src = ../.; }
|
import flake-compat {src = ../.;}
|
||||||
|
Loading…
Reference in New Issue
Block a user