mirror of
https://github.com/pimalaya/himalaya.git
synced 2024-12-09 21:18:39 +03:00
fix shell
This commit is contained in:
4712
Cargo.lock
generated
4712
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
4
build.rs
4
build.rs
@@ -6,11 +6,11 @@
|
|||||||
// use git2::{DescribeOptions, Repository};
|
// use git2::{DescribeOptions, Repository};
|
||||||
// use serde::Deserialize;
|
// use serde::Deserialize;
|
||||||
|
|
||||||
// fn main() {
|
fn main() {
|
||||||
// features_env();
|
// features_env();
|
||||||
// target_envs();
|
// target_envs();
|
||||||
// git_envs();
|
// git_envs();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// Builds the `CARGO_FEATURES` environment variable.
|
// /// Builds the `CARGO_FEATURES` environment variable.
|
||||||
// ///
|
// ///
|
||||||
|
|||||||
25
default.nix
25
default.nix
@@ -1,21 +1,24 @@
|
|||||||
{ target
|
{ target ? null
|
||||||
|
, isStatic ? true
|
||||||
, defaultFeatures ? true
|
, defaultFeatures ? true
|
||||||
, features ? ""
|
, features ? ""
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
systems = import ./systems.nix;
|
|
||||||
system = systems.${target};
|
|
||||||
|
|
||||||
buildPackages = import (fetchTarball "https://github.com/soywod/nixpkgs/archive/master.tar.gz") { };
|
buildPackages = import (fetchTarball "https://github.com/soywod/nixpkgs/archive/master.tar.gz") { };
|
||||||
inherit (buildPackages) stdenv binutils mktemp gnutar zip;
|
inherit (buildPackages) stdenv binutils mktemp gnutar zip;
|
||||||
|
|
||||||
pkgs = import (fetchTarball "https://github.com/soywod/nixpkgs/archive/master.tar.gz") {
|
pkgs = import (fetchTarball "https://github.com/soywod/nixpkgs/archive/master.tar.gz") (
|
||||||
crossSystem = {
|
if isNull target then { } else {
|
||||||
isStatic = true;
|
crossSystem = {
|
||||||
config = target;
|
inherit isStatic;
|
||||||
};
|
config = target;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
systems = import ./systems.nix;
|
||||||
|
system = if isNull target then null else systems.${target};
|
||||||
|
|
||||||
inherit (pkgs) lib hostPlatform;
|
inherit (pkgs) lib hostPlatform;
|
||||||
|
|
||||||
@@ -25,7 +28,7 @@ let
|
|||||||
|
|
||||||
rustToolchain = mkToolchain.fromTarget {
|
rustToolchain = mkToolchain.fromTarget {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
targetSystem = system.rustTarget;
|
targetSystem = if isNull system then null else system.rustTarget;
|
||||||
};
|
};
|
||||||
|
|
||||||
rustPlatform = pkgs.makeRustPlatform {
|
rustPlatform = pkgs.makeRustPlatform {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
# unit tests only
|
# unit tests only
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
auditable = false;
|
||||||
cargoTestFlags = [ "--lib" ];
|
cargoTestFlags = [ "--lib" ];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ]
|
nativeBuildInputs = [ pkg-config ]
|
||||||
|
|||||||
@@ -17,16 +17,14 @@ rec {
|
|||||||
armv7l-unknown-linux-musleabihf = "armv7-unknown-linux-musleabihf";
|
armv7l-unknown-linux-musleabihf = "armv7-unknown-linux-musleabihf";
|
||||||
}.${target} or target;
|
}.${target} or target;
|
||||||
|
|
||||||
fromTarget = { lib, targetSystem }:
|
fromTarget = { lib, targetSystem ? null }:
|
||||||
let
|
let
|
||||||
target = toRustTarget targetSystem;
|
|
||||||
name = (lib.importTOML file).toolchain.channel;
|
name = (lib.importTOML file).toolchain.channel;
|
||||||
toolchain = fenix.fromToolchainName { inherit name sha256; };
|
toolchain = fenix.fromToolchainName { inherit name sha256; };
|
||||||
targetToolchain = fenix.targets.${target}.fromToolchainName { inherit name sha256; };
|
target = if isNull targetSystem then null else toRustTarget targetSystem;
|
||||||
|
components = [ toolchain.rustc toolchain.cargo ]
|
||||||
|
++ lib.optional (!isNull target) (fenix.targets.${target}.fromToolchainName { inherit name sha256; }.rust-std);
|
||||||
in
|
in
|
||||||
fenix.combine [
|
|
||||||
toolchain.rustc
|
fenix.combine components;
|
||||||
toolchain.cargo
|
|
||||||
targetToolchain.rust-std
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
10
shell.nix
10
shell.nix
@@ -1,6 +1,16 @@
|
|||||||
{ pkgs ? import <nixpkgs> { } }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
|
let
|
||||||
|
package = import ./default.nix {
|
||||||
|
isStatic = false;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
|
inputsFrom = [
|
||||||
|
package
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
nixd
|
nixd
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
|
|||||||
Reference in New Issue
Block a user