-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathflake.nix
38 lines (35 loc) · 1.23 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
nixConfig.extra-substituters = [
"https://nix-community.cachix.org"
"https://auxtools.cachix.org"
];
nixConfig.extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"auxtools.cachix.org-1:vh1xH58ZpS5hn7IPOY2fHw1F2QqMxwsdDks/bouqetI="
];
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
naersk.url = "github:nix-community/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, fenix, naersk }:
let
toolchain = fenix.packages.i686-linux.stable.toolchain;
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgsi686Linux;
in
{
packages.x86_64-linux.default = (naersk.lib.x86_64-linux.override {
cargo = toolchain;
rustc = toolchain;
}).buildPackage {
src = ./.;
doCheck = true;
copyLibs = true;
nativeBuildInputs = [ pkgs.stdenv.cc pkgs.openssl_1_1 pkgs.pkg-config ];
CARGO_BUILD_TARGET = "i686-unknown-linux-gnu";
CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER = "${pkgs.stdenv.cc}/bin/${pkgs.stdenv.cc.targetPrefix}cc";
};
};
}