-
Notifications
You must be signed in to change notification settings - Fork 1
/
lisi.nix
29 lines (25 loc) · 913 Bytes
/
lisi.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
# import niv sources and the pinned nixpkgs
{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { }}:
let
# import rust compiler
rust = import ./nix/rust.nix { inherit sources; };
# configure naersk to use our pinned rust compiler
naersk = pkgs.callPackage sources.naersk {
rustc = rust;
# We would use our rust package here. However it
# doesent supports --out-dir as a cargo option right now.
# So we fall back to the buildin cargo
# see https://github.com/nmattia/naersk/issues/100
#cargo = rust;
cargo = pkgs.cargo;
};
# tell nix-build to ignore the `target` directory
src = builtins.filterSource
(path: type: type != "directory" || builtins.baseNameOf path != "target")
./.;
in naersk.buildPackage {
name = "lisi-rust-workspace";
inherit src;
remapPathPrefix =
true; # remove nix store references for a smaller output package
}