1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 13:16:39 +03:00

Improve code style

This commit is contained in:
Hilmar Wiegand 2024-01-17 16:58:34 +01:00 committed by Wez Furlong
parent f6dfa7a9f3
commit 4a2bd549c4

View File

@ -33,22 +33,12 @@
}; };
}; };
outputs = { outputs = inputs @ {self, ...}:
self, inputs.flake-utils.lib.eachDefaultSystem (system: let
flake-utils, overlays = [(import inputs.rust-overlay)];
rust-overlay, pkgs = import (inputs.nixpkgs) {inherit system overlays;};
nixpkgs,
freetype2,
harfbuzz,
libpng,
zlib,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;};
inherit (nixpkgs) lib; inherit (inputs.nixpkgs) lib;
inherit (pkgs) stdenv; inherit (pkgs) stdenv;
nativeBuildInputs = with pkgs; nativeBuildInputs = with pkgs;
@ -57,12 +47,6 @@
ncurses # tic for terminfo ncurses # tic for terminfo
pkg-config pkg-config
python3 python3
rust-bin.stable.latest.minimal
rust-bin.stable.latest.clippy
rust-bin.nightly.latest.rustfmt
rust-bin.nightly.latest.rust-analyzer
] ]
++ lib.optional stdenv.isDarwin perl; ++ lib.optional stdenv.isDarwin perl;
@ -72,11 +56,12 @@
pkgs.zlib pkgs.zlib
] ]
++ lib.optionals stdenv.isLinux [ ++ lib.optionals stdenv.isLinux [
xorg.libX11
xorg.libxcb
libxkbcommon libxkbcommon
openssl openssl
wayland wayland
xorg.libX11
xorg.libxcb
xorg.xcbutil xorg.xcbutil
xorg.xcbutilimage xorg.xcbutilimage
xorg.xcbutilkeysyms xorg.xcbutilkeysyms
@ -92,7 +77,11 @@
++ [pkgs.libiconv] ++ [pkgs.libiconv]
); );
libPath = lib.makeLibraryPath (with pkgs; [libGL vulkan-loader]); libPath = lib.makeLibraryPath (with pkgs; [
xorg.xcbutilimage
libGL
vulkan-loader
]);
rustPlatform = pkgs.makeRustPlatform { rustPlatform = pkgs.makeRustPlatform {
cargo = pkgs.rust-bin.stable.latest.minimal; cargo = pkgs.rust-bin.stable.latest.minimal;
@ -104,7 +93,6 @@
name = "wezterm"; name = "wezterm";
src = ./..; src = ./..;
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
version = self.shortRev or "dev"; version = self.shortRev or "dev";
cargoLock = { cargoLock = {
@ -119,10 +107,10 @@
rm -rf deps/freetype/freetype2 deps/freetype/libpng \ rm -rf deps/freetype/freetype2 deps/freetype/libpng \
deps/freetype/zlib deps/harfbuzz/harfbuzz deps/freetype/zlib deps/harfbuzz/harfbuzz
ln -s ${freetype2} deps/freetype/freetype2 ln -s ${inputs.freetype2} deps/freetype/freetype2
ln -s ${libpng} deps/freetype/libpng ln -s ${inputs.libpng} deps/freetype/libpng
ln -s ${zlib} deps/freetype/zlib ln -s ${inputs.zlib} deps/freetype/zlib
ln -s ${harfbuzz} deps/harfbuzz/harfbuzz ln -s ${inputs.harfbuzz} deps/harfbuzz/harfbuzz
''; '';
postPatch = '' postPatch = ''
@ -142,9 +130,20 @@
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
name = "wezterm-shell"; name = "wezterm-shell";
inherit buildInputs nativeBuildInputs; inherit nativeBuildInputs;
buildInputs =
buildInputs
++ (with pkgs.rust-bin; [
stable.latest.minimal
stable.latest.clippy
nightly.latest.rustfmt
nightly.latest.rust-analyzer
]);
LD_LIBRARY_PATH = libPath; LD_LIBRARY_PATH = libPath;
RUST_BACKTRACE = 1;
}; };
}); });
} }