diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8f16d54 --- /dev/null +++ b/flake.lock @@ -0,0 +1,96 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1767149068, + "narHash": "sha256-TjfAb58Ybz/93e2jP0qD846dj+VqiY7wk+EqsxcZ708=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "6d14586a5917a1ec7f045ac97e6d00c68ea5d9f3", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 03b0f37..57c0fc4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "chatapp"; + description = "chatapp monorepo"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -19,11 +19,13 @@ pname = "chatapp"; version = "0.1.0"; - src = ./.; - cargoLock = { lockFile = ./Cargo.lock; }; + # Point to the backend subdirectory + src = ./backend; + cargoLock = { + lockFile = ./backend/Cargo.lock; + }; nativeBuildInputs = [ rust pkgs.pkg-config ]; - buildInputs = [ openssl ]; OPENSSL_LIB_DIR = "${openssl.out}/lib"; @@ -32,10 +34,11 @@ }; devShells.default = pkgs.mkShell { - packages = - [ rust pkgs.cargo pkgs.rust-analyzer pkgs.pkg-config openssl ]; - OPENSSL_DIR = openssl.dev; - PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; + packages = [ rust pkgs.cargo pkgs.rust-analyzer pkgs.pkg-config openssl ]; + shellHook = '' + export OPENSSL_DIR=${openssl.dev} + export PKG_CONFIG_PATH=${openssl.dev}/lib/pkgconfig + ''; }; }); } diff --git a/src/main.rs b/src/main.rs index d02eab2..8e3b884 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,7 +107,6 @@ async fn main() -> anyhow::Result<()> { Ok(()) } -#[cfg(debug_assertions)] async fn log_json_body(req: Request, next: Next) -> Response { let (parts, body) = req.into_parts();