Skip to content

Commit

Permalink
Merge pull request #15 from linw1995/misc/cross
Browse files Browse the repository at this point in the history
Split dependencies between different targets
  • Loading branch information
linw1995 authored Sep 26, 2024
2 parents 3f52006 + 6422368 commit baaaf9b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ diesel-async = { version = "0.5.0", features = [
"deadpool",
] }
diesel_migrations = { version = "2.2.0", features = ["postgres"] }
openssl-sys = { version = "0.9.102", features = [
"vendored",
] } # static linking required
pq-sys = { version = "0.6.1", features = ["bundled"] } # static linking required

#####################
# search enhancement
Expand Down Expand Up @@ -72,3 +68,7 @@ path = "src/bin/serve.rs"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }

[target.x86_64-unknown-linux-musl.dependencies]
openssl-sys = { version = "0.9.102", features = ["vendored"] }
pq-sys = { version = "0.6.1", features = ["bundled"] }
39 changes: 28 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 18 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,36 @@

inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
stable.url = "github:NixOS/nixpkgs/nixos-24.05";
unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = {
nixpkgs,
stable,
unstable,
utils,
...
}:
utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs {inherit system;};
in
{
pkgs = import stable {inherit system;};
lib = pkgs.lib;
unstable-pkgs = import unstable {inherit system;};
in {
# Used by `nix develop`
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
buildInputs =
[
pkgs.pkg-config

postgresql.lib
openssl.dev
libiconv

darwin.apple_sdk.frameworks.SystemConfiguration
];
pkgs.openssl.dev
pkgs.libiconv
unstable-pkgs.postgresql.dev
]
++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];
};
}
);
Expand Down

0 comments on commit baaaf9b

Please sign in to comment.