2024-04-03 17:44:27 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2024-07-15 10:47:44 +00:00
|
|
|
nur-xin = {
|
|
|
|
url = "git+https://git.xinyang.life/xin/nur.git";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-04-03 17:44:27 +00:00
|
|
|
pre-commit-hooks = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, ... }@inputs: with inputs;
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2024-07-15 10:47:44 +00:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system; overlays = [
|
|
|
|
(self: super: {
|
|
|
|
mini-gdbstub = nur-xin.legacyPackages.${system}.mini-gdbstub;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2024-04-03 17:44:27 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
checks = {
|
|
|
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
|
|
src = ./.;
|
|
|
|
hooks = {
|
|
|
|
trim-trailing-whitespace.enable = true;
|
|
|
|
clang-format = {
|
|
|
|
enable = true;
|
|
|
|
types_or = pkgs.lib.mkForce [ "c" "c++" ];
|
|
|
|
};
|
|
|
|
nil.enable = true;
|
|
|
|
nixpkgs-fmt.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-08-08 08:38:05 +00:00
|
|
|
devShells.default = with pkgs; (mkShell.override { stdenv = ccacheStdenv; }) {
|
2024-04-03 17:44:27 +00:00
|
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
|
|
buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
|
|
|
|
packages = [
|
|
|
|
clang-tools
|
|
|
|
cmake
|
2024-08-08 08:38:05 +00:00
|
|
|
ninja
|
2024-04-03 17:44:27 +00:00
|
|
|
gdb
|
2024-07-15 10:47:44 +00:00
|
|
|
cli11
|
2024-08-08 08:38:05 +00:00
|
|
|
spdlog
|
2024-07-15 10:47:44 +00:00
|
|
|
mini-gdbstub
|
2024-04-03 17:44:27 +00:00
|
|
|
];
|
|
|
|
};
|
2024-07-22 09:30:02 +00:00
|
|
|
packages.default = pkgs.callPackage ./default.nix { };
|
2024-04-03 17:44:27 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|