Cargo.toml: enable uucore logind integration, add systemd compile flag
This commit is contained in:
@@ -28,12 +28,16 @@ toml = "0.9.10"
|
||||
tracing = "0.1.44"
|
||||
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
|
||||
# onc-rpc = "0.3.2"
|
||||
sd-notify = "0.4.5"
|
||||
sd-notify = { version = "0.4.5", optional = true }
|
||||
serde_json = "1.0.148"
|
||||
uucore = { version = "0.5.0", features = ["utmpx"] }
|
||||
zlink = { version = "0.2.0", features = ["introspection"] }
|
||||
clap_complete = "4.5.65"
|
||||
|
||||
[features]
|
||||
default = ["systemd"]
|
||||
systemd = ["sd-notify", "uucore/feat_systemd_logind"]
|
||||
|
||||
[lib]
|
||||
name = "roowho2_lib"
|
||||
path = "src/lib.rs"
|
||||
|
||||
13
flake.nix
13
flake.nix
@@ -53,10 +53,17 @@
|
||||
nativeBuildInputs = with pkgs; [
|
||||
toolchain
|
||||
cargo-edit
|
||||
];
|
||||
] ++ (lib.optionals stdenv.buildPlatform.isLinux [
|
||||
systemdLibs
|
||||
]);
|
||||
|
||||
env.RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
|
||||
env.RUSTFLAGS = "-Zhigher-ranked-assumptions";
|
||||
env = {
|
||||
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
|
||||
RUSTFLAGS = "-Zhigher-ranked-assumptions";
|
||||
CARGO_CFG_FEATURE = lib.concatStringsSep "," (lib.optionals pkgs.stdenv.buildPlatform.isLinux [
|
||||
"systemd"
|
||||
]);
|
||||
};
|
||||
});
|
||||
|
||||
overlays = {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
, buildPackages
|
||||
, installShellFiles
|
||||
, versionCheckHook
|
||||
, systemdLibs
|
||||
|
||||
, cargoToml
|
||||
, cargoLock
|
||||
@@ -21,6 +22,14 @@ rustPlatform.buildRustPackage {
|
||||
|
||||
RUSTFLAGS = "-Zhigher-ranked-assumptions";
|
||||
|
||||
buildFeatures = lib.optionals stdenv.hostPlatform.isLinux [
|
||||
"systemd"
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
||||
systemdLibs
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
postInstall = let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
|
||||
Reference in New Issue
Block a user