-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
56 lines (47 loc) · 1.37 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
{
description = "Wrapper for plain or TLS streams";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
# The rustup equivalent for Nix.
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Allows non-flakes users to still be able to `nix-shell` based on
# `shell.nix` instead of this `flake.nix`.
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, fenix, ... }:
let
inherit (nixpkgs) lib;
eachSupportedSystem = lib.genAttrs supportedSystems;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
mkDevShells = system:
let
pkgs = import nixpkgs { inherit system; };
# get the rust toolchain from the rustup
# `rust-toolchain.toml` configuration file
rust-toolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
# cargo 1.82.0 (8f40fc59f 2024-08-21)
sha256 = "yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
};
in
{
default = pkgs.mkShell {
buildInputs = [ rust-toolchain ];
};
};
in
{
devShells = eachSupportedSystem mkDevShells;
};
}