# Back - An extremely simple git bug visualization system. Inspired by TVL's # panettone. # # Copyright (C) 2025 Benedikt Peetz # SPDX-License-Identifier: AGPL-3.0-or-later # # This file is part of Back. # # You should have received a copy of the License along with this program. # If not, see . { description = "An extremely simple git bug visualization system. Inspired by TVL's panettone."; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; systems = { url = "github:nix-systems/x86_64-linux"; # only evaluate for this system }; flake-utils = { url = "github:numtide/flake-utils"; inputs = { systems.follows = "systems"; }; }; }; outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }: let pkgs = nixpkgs.legacyPackages."x86_64-linux"; back = pkgs.callPackage ./nix/package.nix {}; module = import ./nix/module.nix {extraPackages = {inherit back;};}; in (flake-utils.lib.eachDefaultSystem (system: let treefmtEval = import ./treefmt.nix { inherit treefmt-nix pkgs; }; nixos-lib = import (nixpkgs + "/nixos/lib") {}; rustfmt = pkgs.writeShellScriptBin "rustfmt" '' # Avoid the duplicated edition flag, that rust-analyzer passes. if [ "$1" = "--edition" ] && [ "$2" == "2024" ]; then shift 2 fi ${pkgs.lib.getExe pkgs.rustfmt} ${builtins.concatStringsSep " " treefmtEval.config.settings.formatter.rustfmt.options} "$@" ''; in { checks = { formatting = treefmtEval.config.build.check self; nixos = pkgs.callPackage ./tests/base.nix {inherit module nixos-lib;}; }; formatter = treefmtEval.config.build.wrapper; packages = { inherit back; default = back; }; devShells.default = pkgs.mkShell { packages = [ pkgs.cocogitto pkgs.git-bug pkgs.rustc pkgs.cargo pkgs.clippy rustfmt pkgs.cargo-edit pkgs.reuse ]; }; })) // { nixosModules.default = module; }; } # vim: ts=2