fix: catchup with the latest stable Rust (#409)

This commit is contained in:
XYenon 2023-11-29 20:37:10 +08:00 committed by GitHub
parent 57c7d20d39
commit 8998753625
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 22 deletions

12
flake.lock generated
View file

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1697793076, "lastModified": 1701174899,
"narHash": "sha256-02e7sCuqLtkyRgrZmdOyvAcQTQdcXj+vpyp9bca6cY4=", "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "038b2922be3fc096e1d456f93f7d0f4090628729", "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -51,11 +51,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697854201, "lastModified": 1701224160,
"narHash": "sha256-H+0Wb20PQx/8N7X/OfwwAVPeN9TbfjcyG0sXbdgsh50=", "narHash": "sha256-qnMmxNMKmd6Soel0cfauyMJ+LzuZbvmiDQPSIuTbQ+M=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "6e8e3332433847cd56186b1f6fc8c47603cf5b46", "rev": "4a080e26d55eaedb95ab1bf8eeaeb84149c10f12",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -22,25 +22,28 @@
}; };
}) })
]; ];
in flake-utils.lib.eachDefaultSystem (system: in
let flake-utils.lib.eachDefaultSystem
pkgs = import nixpkgs { inherit system overlays; }; (system:
versionSuffix = "pre${ let
pkgs = import nixpkgs { inherit system overlays; };
versionSuffix = "pre${
builtins.substring 0 8 builtins.substring 0 8
(self.lastModifiedDate or self.lastModified or "19700101") (self.lastModifiedDate or self.lastModified or "19700101")
}_${self.shortRev or "dirty"}"; }_${self.shortRev or "dirty"}";
version = (builtins.fromTOML version = (builtins.fromTOML
(builtins.readFile ./yazi-fm/Cargo.toml)).package.version (builtins.readFile ./yazi-fm/Cargo.toml)).package.version
+ versionSuffix; + versionSuffix;
yazi = pkgs.callPackage ./nix/yazi.nix { inherit version; }; yazi = pkgs.callPackage ./nix/yazi.nix { inherit version; };
in { in
packages.default = yazi; {
packages.yazi = yazi; packages.default = yazi;
packages.yazi = yazi;
formatter = pkgs.nixpkgs-fmt; formatter = pkgs.nixpkgs-fmt;
devShells.default = import ./nix/shell.nix { inherit pkgs inputs; }; devShells.default = import ./nix/shell.nix { inherit pkgs inputs; };
}) })
// { // {
overlays = rec { overlays = rec {
default = yazi; default = yazi;

View file

@ -2,6 +2,7 @@
pkgs.mkShell { pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
rustToolchain
rust-analyzer rust-analyzer
nodePackages.cspell nodePackages.cspell
@ -15,13 +16,11 @@ pkgs.mkShell {
ripgrep ripgrep
fzf fzf
zoxide zoxide
(rust-bin.nightly.latest.rust.override { extensions = [ "rust-src" ]; })
]; ];
buildInputs = with pkgs; buildInputs = with pkgs;
lib.optionals stdenv.isDarwin lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ Foundation ]); (with darwin.apple_sdk.frameworks; [ Foundation ]);
env = { RUST_BACKTRACE = "1"; }; env = { RUST_BACKTRACE = "1"; };
} }