yazi/flake.nix

56 lines
1.5 KiB
Nix
Raw Normal View History

2023-09-22 11:08:17 +03:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
2023-09-22 11:08:17 +03:00
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }@inputs:
let
# Nixpkgs overlays
overlays = [
rust-overlay.overlays.default
(final: prev: {
rustToolchain = final.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
};
})
];
in
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system overlays; };
versionSuffix = "pre${
builtins.substring 0 8
(self.lastModifiedDate or self.lastModified or "19700101")
}_${self.shortRev or "dirty"}";
version = (builtins.fromTOML
(builtins.readFile ./yazi-fm/Cargo.toml)).package.version
+ versionSuffix;
yazi = pkgs.callPackage ./nix/yazi.nix { inherit version; };
in
{
packages.default = yazi;
packages.yazi = yazi;
2023-09-22 11:08:17 +03:00
formatter = pkgs.nixpkgs-fmt;
2023-09-22 11:08:17 +03:00
devShells.default = import ./nix/shell.nix { inherit pkgs inputs; };
})
2023-11-01 16:40:36 +03:00
// {
overlays = rec {
default = yazi;
yazi = final: prev: {
yazi = self.packages."${final.system}".yazi;
};
};
};
2023-09-22 11:08:17 +03:00
}