refactor(nix): clean up with statix and deadnix

This commit is contained in:
uncenter 2024-07-31 15:01:30 -04:00
parent bb29e238b5
commit 7933cc656e
No known key found for this signature in database
3 changed files with 8 additions and 9 deletions

View file

@ -16,7 +16,7 @@
# Nixpkgs overlays
overlays = [
rust-overlay.overlays.default
(final: prev: {
(final: _: {
rustToolchain = final.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
};
@ -28,7 +28,7 @@
let
pkgs = import nixpkgs { inherit system overlays; };
rev = self.shortRev or "dirty";
date = (self.lastModifiedDate or self.lastModified or "19700101");
date = self.lastModifiedDate or self.lastModified or "19700101";
version = (builtins.fromTOML
(builtins.readFile ./yazi-fm/Cargo.toml)).package.version
+ "pre${builtins.substring 0 8 date}_${rev}";
@ -49,9 +49,9 @@
// {
overlays = rec {
default = yazi;
yazi = final: prev: {
yazi-unwrapped = self.packages."${final.system}".yazi-unwrapped;
yazi = self.packages."${final.system}".yazi;
yazi = final: _: {
inherit (self.packages."${final.system}") yazi-unwrapped;
inherit (self.packages."${final.system}") yazi;
};
};
};

View file

@ -12,9 +12,9 @@
, imagemagick
}:
(makeRustPlatform { cargo = rustToolchain; rustc = rustToolchain; }).buildRustPackage rec {
(makeRustPlatform { cargo = rustToolchain; rustc = rustToolchain; }).buildRustPackage {
pname = "yazi";
inherit version rev;
inherit version;
src = ../.;

View file

@ -24,8 +24,7 @@
}:
let
runtimePaths = with lib; [ ]
++ optional withFile file
runtimePaths = with lib; optional withFile file
++ optional withJq jq
++ optional withPoppler poppler_utils
++ optional withUnar unar