yazi/flake.nix

68 lines
1.9 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/b7996075da11a2d441cfbf4e77c2939ce51506fd"; # FIX: pin to a specific commit until cargo-c is updated
2024-08-08 17:18:01 +03:00
inputs.nixpkgs.follows = "nixpkgs";
2023-09-22 11:08:17 +03:00
};
};
outputs =
{
self,
nixpkgs,
rust-overlay,
2024-08-08 17:18:01 +03:00
flake-utils,
...
2024-08-08 17:18:01 +03:00
}:
flake-utils.lib.eachDefaultSystem (
system:
let
2024-08-08 17:18:01 +03:00
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlays.default
(
final: prev:
let
toolchain = final.rust-bin.stable.latest.default;
in
{
rustPlatform = prev.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
}
)
];
};
rev = self.shortRev or self.dirtyShortRev or "dirty";
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}";
in
{
packages = {
2024-08-08 17:18:01 +03:00
yazi-unwrapped = pkgs.callPackage ./nix/yazi-unwrapped.nix { inherit version rev date; };
yazi = pkgs.callPackage ./nix/yazi.nix { inherit (self.packages.${system}) yazi-unwrapped; };
default = self.packages.${system}.yazi;
};
2023-09-22 11:08:17 +03:00
2024-08-08 17:18:01 +03:00
devShells = {
default = pkgs.callPackage ./nix/shell.nix { };
};
2023-09-22 11:08:17 +03:00
2024-08-08 17:18:01 +03:00
formatter = pkgs.nixfmt-rfc-style;
}
)
2023-11-01 16:40:36 +03:00
// {
2024-08-08 17:18:01 +03:00
overlays = {
default = self.overlays.yazi;
yazi = _: prev: { inherit (self.packages.${prev.stdenv.system}) yazi yazi-unwrapped; };
2023-11-01 16:40:36 +03:00
};
};
2023-09-22 11:08:17 +03:00
}