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

Use rust-overlay for flake build

This commit is contained in:
Hilmar Wiegand 2023-12-04 00:30:33 +01:00 committed by Wez Furlong
parent ca0ceb2c2d
commit aaed546947
2 changed files with 47 additions and 12 deletions

View File

@ -92,9 +92,33 @@
"harfbuzz": "harfbuzz",
"libpng": "libpng",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay",
"zlib": "zlib"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1701569797,
"narHash": "sha256-ObvQFAPpC5IVbI2GHedSTQVzYxht2qhBgHHQnh3mYTs=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "516c9477757b628b157780d96d84e8c82b46dc99",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,

View File

@ -4,6 +4,13 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
freetype2 = {
url = "github:wez/freetype2/de8b92dd7ec634e9e2b25ef534c54a3537555c11";
@ -29,6 +36,7 @@
outputs = {
self,
flake-utils,
rust-overlay,
nixpkgs,
freetype2,
harfbuzz,
@ -37,7 +45,8 @@
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;};
inherit (nixpkgs) lib;
inherit (pkgs) stdenv;
@ -48,6 +57,12 @@
ncurses # tic for terminfo
pkg-config
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;
@ -76,8 +91,13 @@
];
libPath = lib.makeLibraryPath (with pkgs; [libGL vulkan-loader]);
rustPlatform = pkgs.makeRustPlatform {
cargo = pkgs.rust-bin.stable.latest.minimal;
rustc = pkgs.rust-bin.stable.latest.minimal;
};
in {
packages.default = pkgs.rustPlatform.buildRustPackage rec {
packages.default = rustPlatform.buildRustPackage rec {
inherit buildInputs nativeBuildInputs;
name = "wezterm";
@ -120,16 +140,7 @@
devShell = pkgs.mkShell {
name = "wezterm-shell";
inherit nativeBuildInputs;
buildInputs =
buildInputs
++ (with pkgs; [
cargo
rustc
rustfmt
rustPackages.clippy
]);
inherit buildInputs nativeBuildInputs;
LD_LIBRARY_PATH = libPath;
};