yep, more dotfiles
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4
5 rust-overlay.url = "github:oxalica/rust-overlay";
6 rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
7 };
8
9 outputs = { self, nixpkgs, rust-overlay }:
10 let
11 inherit (nixpkgs.lib) genAttrs;
12
13 forAllSystems = genAttrs [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
14 forAllPkgs = function: forAllSystems (system: function pkgs.${system});
15
16 pkgs = forAllSystems (system: (import nixpkgs {
17 inherit system;
18 overlays = [ (import rust-overlay) ];
19 }));
20 in
21 {
22 formatter = forAllPkgs (pkgs: pkgs.nixpkgs-fmt);
23
24 devShells = forAllPkgs (pkgs:
25 with pkgs.lib;
26 let
27 file-rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
28 rust-toolchain = file-rust-toolchain.override { extensions = [ "rust-analyzer" ]; };
29 in
30 {
31 default = pkgs.mkShell rec {
32 nativeBuildInputs = with pkgs; [
33 pkg-config
34 rust-toolchain
35 act
36 ];
37
38 buildInputs = with pkgs; [ ];
39
40 RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
41 LD_LIBRARY_PATH = makeLibraryPath buildInputs;
42
43 # RUST_LOG = "";
44 };
45 });
46 };
47}