1 Star 0 Fork 3

中华田园人/typst

forked from Gitee 极速下载/typst 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
flake.nix 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
figsoda 提交于 2023-03-27 16:42 . Add an overlay to the Nix flake (#377)
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
inherit (builtins)
substring
;
inherit (nixpkgs.lib)
genAttrs
optionals
;
eachSystem = f: genAttrs
[
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
]
(system: f nixpkgs.legacyPackages.${system});
rev = fallback:
if self ? rev then
substring 0 8 self.rev
else
fallback;
packageFor = pkgs: pkgs.rustPlatform.buildRustPackage {
pname = "typst";
version = rev "00000000";
src = self;
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
buildInputs = optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.CoreServices
];
cargoBuildFlags = [ "-p" "typst-cli" ];
cargoTestFlags = [ "-p" "typst-cli" ];
TYPST_VERSION = rev "(unknown version)";
};
in
{
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
cargo
clippy
rust-analyzer
rustc
rustfmt
];
buildInputs = optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.CoreServices
pkgs.libiconv
];
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
};
});
formatter = eachSystem (pkgs: pkgs.nixpkgs-fmt);
overlays.default = _: prev: {
typst-dev = packageFor prev;
};
packages = eachSystem (pkgs: {
default = packageFor pkgs;
});
};
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/Chinese_pastoral_person/typst.git
git@gitee.com:Chinese_pastoral_person/typst.git
Chinese_pastoral_person
typst
typst
main

搜索帮助