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

View file

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

View file

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