Fix flake (version wasn't found anymore) (#1282)

This commit is contained in:
sbatial 2023-05-22 11:10:48 +02:00 committed by GitHub
parent eb60ea69c4
commit e7aadbd580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
{ {