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

View file

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

View file

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