forked from Orbis-Tertius/tiny-ram-halo2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
52 lines (50 loc) · 1.86 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.dream2nix = { url = "github:nix-community/dream2nix"; inputs.nixpkgs.follows = "nixpkgs"; };
inputs.fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; };
outputs = { self, nixpkgs, dream2nix, fenix }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
channelVersion = "1.63.0";
toolchain = fenix.packages.x86_64-linux.toolchainOf {
channel = channelVersion;
sha256 = "sha256-KXx+ID0y4mg2B3LHp7IyaiMrdexF6octADnAtFIOjrY=";
};
in
(dream2nix.lib.makeFlakeOutputs {
systems = [ "x86_64-linux" ];
config.projectRoot = ./.;
source = ./.;
packageOverrides.tiny-ram-halo2 = {
set-toolchain.overrideRustToolchain = old: { inherit (toolchain) cargo rustc; };
freetype-sys.nativeBuildInputs = old: old ++ [ pkgs.cmake ];
expat-sys.nativeBuildInputs = old: old ++ [ pkgs.cmake ];
servo-fontconfig-sys = {
nativeBuildInputs = old: old ++ [ pkgs.pkg-config ];
buildInputs = old: old ++ [ pkgs.fontconfig ];
};
};
})
// {
checks.x86_64-linux.tiny-ram-halo2 = self.packages.x86_64-linux.tiny-ram-halo2;
devShells.x86_64-linux.default =
let
rust-toolchain = (pkgs.formats.toml { }).generate "rust-toolchain.toml" {
toolchain = {
channel = channelVersion;
components = [ "rustc" "rustfmt" "rust-src" "cargo" "clippy" "rust-docs" ];
};
};
in
pkgs.mkShell {
shellHook = "cp --no-preserve=mode ${rust-toolchain} rust-toolchain.toml";
packages = [
pkgs.rustup
fenix.packages.x86_64-linux.rust-analyzer
pkgs.cmake
pkgs.pkg-config
pkgs.fontconfig
];
};
};
}