-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
72 lines (63 loc) · 1.83 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "A very basic flake";
nixConfig.extra-substituters = [
"https://nix-community.cachix.org"
];
nixConfig.extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-parts, fenix, ... } @ inputs:
(flake-parts.lib.evalFlakeModule
{ inherit inputs; }
{
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
imports = [
];
perSystem = {system, self', inputs', pkgs, ...}: let
fenixPkgs = fenix.packages.${system};
toolchain = fenixPkgs.stable;
rustToolchain = fenixPkgs.combine [
toolchain.cargo
toolchain.rustc
toolchain.rust-src
toolchain.rust-std
toolchain.clippy
toolchain.rustfmt
#targets.x86_64-unknown-linux-musl.stable.rust-std
# fenix.packages.x86_64-linux.targets.aarch64-unknown-linux-gnu.latest.rust-std
];
rustPlatform = (pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
});
in {
devShells.default = with pkgs; mkShell {
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
buildInputs = [
rustToolchain
fenixPkgs.rust-analyzer
just
];
};
packages.default = rustPlatform.buildRustPackage {
name = "hosthog";
src = self;
buildInputs = [];
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
};
};
};
};
}).config.flake;
}