chore(nix): format code using alejandra

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-03-14 10:48:19 +01:00
parent e0e26a37b5
commit 9dff1bac83
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951
3 changed files with 100 additions and 90 deletions

View File

@ -3,12 +3,22 @@
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,
nixpkgs,
libnbtplusplus,
...
}: let
# User-friendly version number. # User-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate; version = builtins.substring 0 8 self.lastModifiedDate;
@ -25,10 +35,11 @@
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 in
{
packages = forAllSystems (system:
let packages = packagesFn pkgs.${system}; in
packages // {default = packages.prismlauncher;} packages // {default = packages.prismlauncher;}
); );

View File

@ -1,33 +1,32 @@
{ 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;
@ -35,7 +34,8 @@ stdenv.mkDerivation rec {
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 qtbase
qtsvg qtsvg
zlib zlib
@ -43,9 +43,11 @@ stdenv.mkDerivation rec {
ghc_filesystem ghc_filesystem
tomlplusplus tomlplusplus
cmark cmark
] ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland; ]
++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland;
cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ] cmakeFlags =
lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"]
++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"]; ++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"];
dontWrapQtApps = true; dontWrapQtApps = true;
@ -57,8 +59,7 @@ 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
@ -72,8 +73,7 @@ stdenv.mkDerivation rec {
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 # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
wrapQtApp $out/bin/prismlauncher \ wrapQtApp $out/bin/prismlauncher \
--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \ --set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
@ -81,7 +81,6 @@ stdenv.mkDerivation rec {
--prefix PATH : ${lib.makeBinPath [xorg.xrandr]} --prefix PATH : ${lib.makeBinPath [xorg.xrandr]}
''; '';
meta = with lib; { meta = with lib; {
homepage = "https://prismlauncher.org/"; homepage = "https://prismlauncher.org/";
description = "A free, open source launcher for Minecraft"; description = "A free, open source launcher for Minecraft";