Personal ATProto tools.
1{
2 description = "Rust development environment and shell";
3 inputs = {
4 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5 flake-utils.url = "github:numtide/flake-utils";
6 rust-overlay = {
7 url = "github:oxalica/rust-overlay";
8 inputs = {
9 nixpkgs.follows = "nixpkgs";
10 flake-utils.follows = "flake-utils";
11 };
12 };
13 };
14 outputs = { self, nixpkgs, flake-utils, rust-overlay }:
15 flake-utils.lib.eachDefaultSystem
16 (system:
17 let
18 buildInputs = with pkgs; [
19 udev
20 alsa-lib
21 vulkan-loader
22 xorg.libX11
23 xorg.libXcursor
24 xorg.libXi
25 xorg.libXrandr # To use the x11 feature
26 libxkbcommon
27 wayland # To use the wayland feature
28 openssl
29 pkg-config
30 gcc
31 pkg-config
32 rust
33 bacon
34 clippy
35 trunk# For WASM development
36 # tracy # Profiler
37 sqlite
38 sqlite-web
39 ];
40 overlays = [ (import rust-overlay) ];
41 pkgs = import nixpkgs {
42 inherit system overlays;
43 };
44 rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
45 extensions = [
46 "rust-src" # for rust-analyzer
47 "rust-analyzer"
48 ];
49 targets = [ "wasm32-unknown-unknown" ];
50 });
51 nativeBuildInputs = with pkgs; [ rust pkg-config ];
52 in
53 with pkgs;
54 {
55 devShells.default = mkShell {
56 inherit buildInputs nativeBuildInputs;
57 LD_LIBRARY_PATH = nixpkgs.legacyPackages.x86_64-linux.lib.makeLibraryPath buildInputs;
58 RUST_BACKTRACE = 1;
59 DATABASE_URL = "sqlite://prod.db";
60 };
61 }
62 );
63}