# rocie - An enterprise grocery management system # # Copyright (C) 2024 Benedikt Peetz # Copyright (C) 2025 Benedikt Peetz # Copyright (C) 2026 Benedikt Peetz # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Rocie. # # You should have received a copy of the License along with this program. # If not, see . { lib, rustPlatform, # nativeBuildInputs pkg-config, sqlite, fd, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "rocie-server"; inherit ((builtins.fromTOML (builtins.readFile ../Cargo.toml)).workspace.package) version ; src = lib.cleanSourceWith { src = lib.cleanSource ./..; filter = name: type: (type == "directory") || (builtins.elem (builtins.baseNameOf name) [ "Cargo.toml" "Cargo.lock" "mkdb.sh" ]) || (lib.strings.hasSuffix ".rs" (builtins.baseNameOf name)) || (lib.strings.hasSuffix ".sql" (builtins.baseNameOf name)); }; nativeBuildInputs = [ pkg-config # Needed for the `mkdb.sh` sqlite fd ]; buildInputs = [ sqlite.dev ]; checkInputs = [ ]; env = { # Needed for the compile time sqlite checks. DATABASE_URL = "sqlite://database.sqlx"; }; doCheck = true; prePatch = '' # Generate the sqlite db, so that we can run the comp-time sqlite checks. bash ./scripts/mkdb.sh ''; cargoLock = { lockFile = ../Cargo.lock; }; meta = { mainProgram = "rocie-server"; }; })