forked from sxyazi/yazi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (56 loc) · 1.73 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
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";
};
};
};
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-unwrapped = pkgs.callPackage ./nix/yazi-unwrapped.nix { inherit version; };
yazi = pkgs.callPackage ./nix/yazi.nix { inherit yazi-unwrapped; };
in
{
packages = {
inherit yazi-unwrapped yazi;
default = yazi;
};
formatter = pkgs.nixpkgs-fmt;
devShells.default = import ./nix/shell.nix { inherit pkgs inputs; };
})
// {
overlays = rec {
default = yazi;
yazi = final: prev: {
yazi-unwrapped = self.packages."${final.system}".yazi-unwrapped;
yazi = self.packages."${final.system}".yazi;
};
};
};
}