moved the nix flake to the root, it is meant for the backend

This commit is contained in:
2025-12-31 16:38:48 +01:00
parent 41ec77c862
commit fa40aa404d
3 changed files with 107 additions and 9 deletions

96
flake.lock generated Normal file
View File

@@ -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
}

View File

@@ -1,5 +1,5 @@
{ {
description = "chatapp"; description = "chatapp monorepo";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@@ -19,11 +19,13 @@
pname = "chatapp"; pname = "chatapp";
version = "0.1.0"; version = "0.1.0";
src = ./.; # Point to the backend subdirectory
cargoLock = { lockFile = ./Cargo.lock; }; src = ./backend;
cargoLock = {
lockFile = ./backend/Cargo.lock;
};
nativeBuildInputs = [ rust pkgs.pkg-config ]; nativeBuildInputs = [ rust pkgs.pkg-config ];
buildInputs = [ openssl ]; buildInputs = [ openssl ];
OPENSSL_LIB_DIR = "${openssl.out}/lib"; OPENSSL_LIB_DIR = "${openssl.out}/lib";
@@ -32,10 +34,11 @@
}; };
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
packages = packages = [ rust pkgs.cargo pkgs.rust-analyzer pkgs.pkg-config openssl ];
[ rust pkgs.cargo pkgs.rust-analyzer pkgs.pkg-config openssl ]; shellHook = ''
OPENSSL_DIR = openssl.dev; export OPENSSL_DIR=${openssl.dev}
PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; export PKG_CONFIG_PATH=${openssl.dev}/lib/pkgconfig
'';
}; };
}); });
} }

View File

@@ -107,7 +107,6 @@ async fn main() -> anyhow::Result<()> {
Ok(()) Ok(())
} }
#[cfg(debug_assertions)]
async fn log_json_body(req: Request, next: Next) -> Response { async fn log_json_body(req: Request, next: Next) -> Response {
let (parts, body) = req.into_parts(); let (parts, body) = req.into_parts();