diff options
Diffstat (limited to '')
| -rw-r--r-- | flake.nix | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..bd155ca --- /dev/null +++ b/flake.nix @@ -0,0 +1,95 @@ +# rocie - An enterprise grocery management system +# +# Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + 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"; + }; + }; + }; + + outputs = { + self, + nixpkgs, + treefmt-nix, + rust-overlay, + }: let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + overlays = [(import rust-overlay)]; + }; + + buildInputs = [ + pkgs.openssl + ]; + + nativeBuildInputs = [ + pkgs.pkg-config + ]; + + rocie = pkgs.callPackage ./nix/package.nix {}; + + rust = pkgs.rust-bin.stable.latest.default.override { + targets = ["wasm32-unknown-unknown"]; + }; + + 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-wrapped + + pkgs.cargo-edit + pkgs.cargo-expand + pkgs.cargo-flamegraph + + # Mobile app + pkgs.trunk + pkgs.wasm-bindgen-cli + pkgs.dart-sass + + # Releng + pkgs.git-bug + pkgs.reuse + pkgs.cocogitto + ]; + }; + }; +} |
