mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
Allow customizing features
This commit is contained in:
parent
bd9a5a1b1d
commit
26b0e3b21d
2 changed files with 39 additions and 19 deletions
36
package.nix
Normal file
36
package.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ naersk
|
||||
, lib
|
||||
, stdenv
|
||||
, pkg-config
|
||||
, openssl
|
||||
|
||||
, enableCodeforces ? true
|
||||
, enableOsu ? true
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
customizeFeatures = !(enableCodeforces && enableOsu);
|
||||
featureFlags = lib.optionals customizeFeatures (
|
||||
[ "--no-default-features" "--features=core" ]
|
||||
++ lib.optional enableCodeforces "--features=codeforces"
|
||||
++ lib.optional enableOsu "--features=osu"
|
||||
);
|
||||
in
|
||||
naersk.buildPackage {
|
||||
name = "youmubot";
|
||||
version = "0.1.0";
|
||||
|
||||
root = ./.;
|
||||
cargoBuildOptions = opts: opts ++ [ "--package youmubot" ] ++ featureFlags;
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
];
|
||||
|
||||
nativeBuildInputs = lib.optionals stdenv.isLinux [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
SQLX_OFFLINE = "true";
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue