mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
feat(nix): set VERGEN_* build env vars (#1375)
This commit is contained in:
parent
4257b95e8d
commit
bb29e238b5
2 changed files with 9 additions and 7 deletions
10
flake.nix
10
flake.nix
|
|
@ -27,15 +27,13 @@
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
versionSuffix = "pre${
|
rev = self.shortRev or "dirty";
|
||||||
builtins.substring 0 8
|
date = (self.lastModifiedDate or self.lastModified or "19700101");
|
||||||
(self.lastModifiedDate or self.lastModified or "19700101")
|
|
||||||
}_${self.shortRev or "dirty"}";
|
|
||||||
version = (builtins.fromTOML
|
version = (builtins.fromTOML
|
||||||
(builtins.readFile ./yazi-fm/Cargo.toml)).package.version
|
(builtins.readFile ./yazi-fm/Cargo.toml)).package.version
|
||||||
+ versionSuffix;
|
+ "pre${builtins.substring 0 8 date}_${rev}";
|
||||||
|
|
||||||
yazi-unwrapped = pkgs.callPackage ./nix/yazi-unwrapped.nix { inherit version; };
|
yazi-unwrapped = pkgs.callPackage ./nix/yazi-unwrapped.nix { inherit version rev date; };
|
||||||
yazi = pkgs.callPackage ./nix/yazi.nix { inherit yazi-unwrapped; };
|
yazi = pkgs.callPackage ./nix/yazi.nix { inherit yazi-unwrapped; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
{ makeRustPlatform
|
{ makeRustPlatform
|
||||||
, rustToolchain
|
, rustToolchain
|
||||||
, version ? "git"
|
, version ? "git"
|
||||||
|
, rev
|
||||||
|
, date
|
||||||
, lib
|
, lib
|
||||||
|
|
||||||
, installShellFiles
|
, installShellFiles
|
||||||
|
|
@ -12,7 +14,7 @@
|
||||||
|
|
||||||
(makeRustPlatform { cargo = rustToolchain; rustc = rustToolchain; }).buildRustPackage rec {
|
(makeRustPlatform { cargo = rustToolchain; rustc = rustToolchain; }).buildRustPackage rec {
|
||||||
pname = "yazi";
|
pname = "yazi";
|
||||||
inherit version;
|
inherit version rev;
|
||||||
|
|
||||||
src = ../.;
|
src = ../.;
|
||||||
|
|
||||||
|
|
@ -24,6 +26,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
env.YAZI_GEN_COMPLETIONS = true;
|
env.YAZI_GEN_COMPLETIONS = true;
|
||||||
|
env.VERGEN_GIT_SHA = rev;
|
||||||
|
env.VERGEN_BUILD_DATE = builtins.concatStringsSep "-" (builtins.match "(.{4})(.{2})(.{2}).*" date);
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles imagemagick ];
|
nativeBuildInputs = [ installShellFiles imagemagick ];
|
||||||
buildInputs = lib.optionals stdenv.isDarwin (
|
buildInputs = lib.optionals stdenv.isDarwin (
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue