mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-05-06 13:38:04 +03:00
fix minimal flake deps
This commit is contained in:
parent
c84a92f417
commit
f4964244ec
25
flake.nix
25
flake.nix
@ -12,14 +12,12 @@
|
|||||||
systems = [ "x86_64-linux" ];
|
systems = [ "x86_64-linux" ];
|
||||||
perSystem = { config, self', pkgs, lib, system, ... }:
|
perSystem = { config, self', pkgs, lib, system, ... }:
|
||||||
let
|
let
|
||||||
runtimeDeps = with pkgs; [ pkg-config openssl ];
|
|
||||||
buildDeps = with pkgs; [ pkg-config openssl ];
|
|
||||||
devDeps = with pkgs; [ pkg-config openssl ];
|
devDeps = with pkgs; [ pkg-config openssl ];
|
||||||
|
|
||||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||||
msrv = cargoToml.package.rust-version;
|
msrv = cargoToml.package.rust-version;
|
||||||
|
|
||||||
rustPackage = { version, features }:
|
rustPackage = { version, features, deps }:
|
||||||
(pkgs.makeRustPlatform {
|
(pkgs.makeRustPlatform {
|
||||||
cargo = pkgs.rust-bin.stable.latest.minimal;
|
cargo = pkgs.rust-bin.stable.latest.minimal;
|
||||||
rustc = pkgs.rust-bin.stable.latest.minimal;
|
rustc = pkgs.rust-bin.stable.latest.minimal;
|
||||||
@ -28,9 +26,10 @@
|
|||||||
src = ./.;
|
src = ./.;
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
version = lib.concatStrings [ cargoToml.package.version version ];
|
version = lib.concatStrings [ cargoToml.package.version version ];
|
||||||
|
buildNoDefaultFeatures = true;
|
||||||
buildFeatures = features;
|
buildFeatures = features;
|
||||||
buildInputs = runtimeDeps;
|
buildInputs = deps;
|
||||||
nativeBuildInputs = buildDeps;
|
nativeBuildInputs = deps;
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace Cargo.toml --replace \
|
substituteInPlace Cargo.toml --replace \
|
||||||
'version = "${cargoToml.package.version}"' \
|
'version = "${cargoToml.package.version}"' \
|
||||||
@ -43,8 +42,8 @@
|
|||||||
shellHook = ''
|
shellHook = ''
|
||||||
export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
|
export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
|
||||||
'';
|
'';
|
||||||
buildInputs = runtimeDeps;
|
buildInputs = devDeps;
|
||||||
nativeBuildInputs = buildDeps ++ devDeps ++ [ rustc ];
|
nativeBuildInputs = devDeps ++ [ rustc ];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
_module.args.pkgs = import inputs.nixpkgs {
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
@ -55,8 +54,16 @@
|
|||||||
packages.default = self'.packages.bRAC;
|
packages.default = self'.packages.bRAC;
|
||||||
devShells.default = self'.devShells.stable;
|
devShells.default = self'.devShells.stable;
|
||||||
|
|
||||||
packages.bRAC = (rustPackage { version = ""; features = "default"; });
|
packages.bRAC = (rustPackage {
|
||||||
packages.bRAC-minimal = (rustPackage { version = "-minimal"; features = ""; });
|
version = "";
|
||||||
|
features = "default";
|
||||||
|
deps = with pkgs; [ pkg-config openssl ];
|
||||||
|
});
|
||||||
|
packages.bRAC-minimal = (rustPackage {
|
||||||
|
version = "-minimal";
|
||||||
|
features = "";
|
||||||
|
deps = [];
|
||||||
|
});
|
||||||
|
|
||||||
devShells.nightly = (mkDevShell (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)));
|
devShells.nightly = (mkDevShell (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)));
|
||||||
devShells.stable = (mkDevShell pkgs.rust-bin.stable.latest.default);
|
devShells.stable = (mkDevShell pkgs.rust-bin.stable.latest.default);
|
||||||
|
Loading…
Reference in New Issue
Block a user