From 84d9a86be8ee216b47920ff3f98b567aa1d296c0 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 31 Aug 2025 23:44:08 +0200 Subject: chore: Initial commit --- flake.nix | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a0c5b0e --- /dev/null +++ b/flake.nix @@ -0,0 +1,84 @@ +# rocie - An enterprise grocery management system +# +# Copyright (C) 2024 Benedikt Peetz +# Copyright (C) 2025 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"; + }; + }; + }; + + outputs = { + self, + nixpkgs, + treefmt-nix, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages."${system}"; + + buildInputs = [ + ]; + + nativeBuildInputs = [ + ]; + + rocie = pkgs.callPackage ./nix/package.nix {}; + + 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 + pkgs.cargo + pkgs.clippy + pkgs.rustc + pkgs.rustfmt + pkgs.mold-wrapped + + pkgs.cargo-edit + pkgs.cargo-expand + pkgs.cargo-flamegraph + + # Releng + pkgs.git-bug + pkgs.reuse + pkgs.cocogitto + + # Perf + pkgs.hyperfine + + # Sqlite + pkgs.sqlite-interactive + ]; + }; + }; +} -- cgit 1.4.1