summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsbatial <46973479+sbatial@users.noreply.github.com>2023-05-22 11:10:48 +0200
committerGitHub <noreply@github.com>2023-05-22 11:10:48 +0200
commite7aadbd580cb9c8d6c984d3970a4576d53028a6a (patch)
tree78e538a0364a4621aa9e36de0cb9ba4bf4d296ea
parenteb60ea69c42fdf556db74e4d7eedd02c1644da6c (diff)
Fix flake (version wasn't found anymore) (#1282)
-rw-r--r--flake.nix17
1 files changed, 6 insertions, 11 deletions
diff --git a/flake.nix b/flake.nix
index 5314d259..aa3f36d4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,13 +5,11 @@
outputs = { self, nixpkgs }:
let
- inherit (builtins)
- substring
- ;
inherit (nixpkgs.lib)
genAttrs
importTOML
optionals
+ cleanSource
;
eachSystem = f: genAttrs
@@ -24,16 +22,13 @@
(system: f nixpkgs.legacyPackages.${system});
rev = fallback:
- if self ? rev then
- substring 0 8 self.rev
- else
- fallback;
+ self.shortRev or fallback;
- packageFor = pkgs: pkgs.rustPlatform.buildRustPackage {
+ packageFor = pkgs: pkgs.rustPlatform.buildRustPackage rec {
pname = "typst";
- version = rev "00000000";
+ inherit ((importTOML ./Cargo.toml).workspace.package) version;
- src = self;
+ src = cleanSource ./.;
cargoLock = {
lockFile = ./Cargo.lock;
@@ -56,7 +51,7 @@
'';
GEN_ARTIFACTS = "artifacts";
- TYPST_VERSION = "${(importTOML ./Cargo.toml).package.version} (${rev "unknown hash"})";
+ TYPST_VERSION = "${version} (${rev "unknown hash"})";
};
in
{