mirror of
https://github.com/typst/typst
synced 2025-05-20 20:15:29 +08:00
Fix flake (version wasn't found anymore) (#1282)
This commit is contained in:
parent
eb60ea69c4
commit
e7aadbd580
17
flake.nix
17
flake.nix
@ -5,13 +5,11 @@
|
|||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs }:
|
||||||
let
|
let
|
||||||
inherit (builtins)
|
|
||||||
substring
|
|
||||||
;
|
|
||||||
inherit (nixpkgs.lib)
|
inherit (nixpkgs.lib)
|
||||||
genAttrs
|
genAttrs
|
||||||
importTOML
|
importTOML
|
||||||
optionals
|
optionals
|
||||||
|
cleanSource
|
||||||
;
|
;
|
||||||
|
|
||||||
eachSystem = f: genAttrs
|
eachSystem = f: genAttrs
|
||||||
@ -24,16 +22,13 @@
|
|||||||
(system: f nixpkgs.legacyPackages.${system});
|
(system: f nixpkgs.legacyPackages.${system});
|
||||||
|
|
||||||
rev = fallback:
|
rev = fallback:
|
||||||
if self ? rev then
|
self.shortRev or fallback;
|
||||||
substring 0 8 self.rev
|
|
||||||
else
|
|
||||||
fallback;
|
|
||||||
|
|
||||||
packageFor = pkgs: pkgs.rustPlatform.buildRustPackage {
|
packageFor = pkgs: pkgs.rustPlatform.buildRustPackage rec {
|
||||||
pname = "typst";
|
pname = "typst";
|
||||||
version = rev "00000000";
|
inherit ((importTOML ./Cargo.toml).workspace.package) version;
|
||||||
|
|
||||||
src = self;
|
src = cleanSource ./.;
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ./Cargo.lock;
|
||||||
@ -56,7 +51,7 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
GEN_ARTIFACTS = "artifacts";
|
GEN_ARTIFACTS = "artifacts";
|
||||||
TYPST_VERSION = "${(importTOML ./Cargo.toml).package.version} (${rev "unknown hash"})";
|
TYPST_VERSION = "${version} (${rev "unknown hash"})";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user