# rocie - An enterprise grocery management system - Web app # # 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 . { description = "rocie"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; crane.url = "github:ipetkov/crane"; }; outputs = { self, nixpkgs, treefmt-nix, rust-overlay, crane, }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; overlays = [(import rust-overlay)]; }; buildInputs = [ pkgs.openssl ]; nativeBuildInputs = [ pkgs.pkg-config ]; rust = pkgs.rust-bin.stable.latest.default.override { targets = ["wasm32-unknown-unknown"]; }; # NB: we don't need to overlay our custom toolchain for the *entire* # pkgs (which would require rebuidling anything else which uses rust). # Instead, we just want to update the scope that crane will use by appending # our specific toolchain there. craneLib = (crane.mkLib pkgs).overrideToolchain ( p: p.rust-bin.stable.latest.default.override { targets = ["wasm32-unknown-unknown"]; } ); rocie = pkgs.callPackage ./nix/package.nix {inherit craneLib;}; treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; in { packages."${system}" = { inherit rocie; default = self.packages.${system}.rocie; }; checks."${system}" = { inherit rocie; formatting = treefmtEval.config.build.check self; }; formatter."${system}" = treefmtEval.config.build.wrapper; devShells."${system}".default = pkgs.mkShell { inherit buildInputs nativeBuildInputs; packages = [ # rust stuff rust pkgs.mold pkgs.cargo-edit pkgs.cargo-expand pkgs.cargo-flamegraph # Mobile app pkgs.trunk pkgs.wasm-bindgen-cli pkgs.dart-sass pkgs.tailwindcss # Releng pkgs.git-bug pkgs.reuse pkgs.cocogitto ]; }; }; }