diff options
| author | figsoda <figsoda@pm.me> | 2023-06-28 06:32:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-28 12:32:21 +0200 |
| commit | 084c8642db13b93ed6bd0b6808bcd16c8dfeaf99 (patch) | |
| tree | 625256846aba71aad9892bfaf6a63ab0b8237614 | |
| parent | c44bad5739d971cb9de8c9998da384ba9a6d76c8 (diff) | |
Reduce rebuilds for the Nix flake (#1586)
This makes it so the package doesn't need to be rebuilt when unrelated
changes happen, e.g. in README
| -rw-r--r-- | flake.nix | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -13,7 +13,7 @@ genAttrs importTOML optionals - cleanSource + sourceByRegex ; eachSystem = f: genAttrs @@ -25,9 +25,6 @@ ] (system: f nixpkgs.legacyPackages.${system}); - rev = fallback: - self.shortRev or fallback; - packageFor = pkgs: let rust = fenix.packages.${pkgs.stdenv.hostPlatform.system}.minimal.toolchain; @@ -36,11 +33,15 @@ rustc = rust; }; in - rustPlatform.buildRustPackage rec { + rustPlatform.buildRustPackage { pname = "typst"; inherit ((importTOML ./Cargo.toml).workspace.package) version; - src = cleanSource ./.; + src = sourceByRegex ./. [ + "(assets|cli|docs|library|macros|src|tests)(/.*)?" + ''Cargo\.(toml|lock)'' + ''build\.rs'' + ]; cargoLock = { lockFile = ./Cargo.lock; @@ -63,7 +64,6 @@ ''; GEN_ARTIFACTS = "artifacts"; - TYPST_VERSION = "${version} (${rev "unknown hash"})"; }; in { |
