mirror of
https://github.com/Hopiu/lychee.git
synced 2026-05-22 04:21:52 +00:00
Reuse nixpkgs recipe as suggested by @tirimia
This commit is contained in:
parent
38645a1c1c
commit
1501b379e0
2 changed files with 8 additions and 39 deletions
37
default.nix
37
default.nix
|
|
@ -1,37 +0,0 @@
|
|||
{ pkgs }:
|
||||
let
|
||||
version =
|
||||
let
|
||||
cargoToml = builtins.readFile ./Cargo.toml;
|
||||
match = builtins.match ''.*version = "([^"]+)".*'' cargoToml;
|
||||
in
|
||||
if match != null then builtins.elemAt match 0 else throw "Version not found in Cargo.toml";
|
||||
in
|
||||
{
|
||||
app = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "lychee";
|
||||
inherit version;
|
||||
src = ./.;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
buildInputs =
|
||||
[ pkgs.openssl ]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
|
||||
pkgs.Security
|
||||
pkgs.SystemConfiguration
|
||||
];
|
||||
|
||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||
RUST_BACKTRACE = 1;
|
||||
|
||||
checkFlags = [
|
||||
"--skip=src/lib.rs"
|
||||
"--skip=client::tests"
|
||||
"--skip=collector::tests::test_url_without_extension_is_html"
|
||||
];
|
||||
};
|
||||
}
|
||||
10
flake.nix
10
flake.nix
|
|
@ -9,6 +9,7 @@
|
|||
{
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -51,10 +52,15 @@
|
|||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
code = import ./default.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
default = code.app;
|
||||
default = pkgs.lychee.overrideAttrs {
|
||||
src = ./.;
|
||||
version = self.rev or self.dirtyShortRev;
|
||||
cargoDeps = pkgs.rustPlatform.importCargoLock {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue