fix(nix): shell env (#3363)

This commit is contained in:
XYenon 2025-11-24 19:55:41 +08:00 committed by GitHub
parent 449450d0db
commit c725c91df1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 20 deletions

12
flake.lock generated
View file

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1762286042, "lastModified": 1763806073,
"narHash": "sha256-OD5HsZ+sN7VvNucbrjiCz7CHF5zf9gP51YVJvPwYIH8=", "narHash": "sha256-FHsEKDvfWpzdADWj99z7vBk4D716Ujdyveo5+A048aI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "12c1f0253aa9a54fdf8ec8aecaafada64a111e24", "rev": "878e468e02bfabeda08c79250f7ad583037f2227",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -48,11 +48,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1762396738, "lastModified": 1763952169,
"narHash": "sha256-BarSecuxtzp1boERdABLkkoxQTi6s/V33lJwUbWLrLY=", "narHash": "sha256-+PeDBD8P+NKauH+w7eO/QWCIp8Cx4mCfWnh9sJmy9CM=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "c63598992afd54d215d54f2b764adc0484c2b159", "rev": "ab726555a9a72e6dc80649809147823a813fa95b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -52,10 +52,13 @@
}; };
devShells = { devShells = {
default = pkgs.callPackage ./nix/shell.nix { }; default = pkgs.callPackage ./nix/shell.nix {
inherit toolchain;
inherit (self.packages.${system}) yazi yazi-unwrapped;
};
}; };
formatter = pkgs.nixfmt-rfc-style; formatter = pkgs.nixfmt-tree;
} }
) )
// { // {

View file

@ -1,14 +1,14 @@
{ {
callPackage, mkShell,
rust-bin, yazi,
toolchain,
nodePackages, nodePackages,
yazi-unwrapped,
}: }:
let
mainPkg = callPackage ./yazi.nix { }; mkShell {
in packages = yazi.passthru.runtimePaths ++ [
mainPkg.overrideAttrs (oa: { (toolchain.override {
nativeBuildInputs = [
(rust-bin.nightly.latest.default.override {
extensions = [ extensions = [
"rust-src" "rust-src"
"rustfmt" "rustfmt"
@ -16,10 +16,10 @@ mainPkg.overrideAttrs (oa: {
"clippy" "clippy"
]; ];
}) })
nodePackages.cspell nodePackages.cspell
] ];
++ (oa.nativeBuildInputs or [ ]);
inputsFrom = [ yazi-unwrapped ];
env.RUST_BACKTRACE = "1"; env.RUST_BACKTRACE = "1";
}) }

View file

@ -96,6 +96,8 @@ runCommand yazi-unwrapped.name
inherit (yazi-unwrapped) pname version meta; inherit (yazi-unwrapped) pname version meta;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
passthru.runtimePaths = runtimePaths;
} }
'' ''
mkdir -p $out/bin mkdir -p $out/bin