2023-04-04 17:48:04 +02:00
|
|
|
{
|
|
|
|
description = "A C++ project";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
futils = {
|
|
|
|
type = "github";
|
|
|
|
owner = "numtide";
|
|
|
|
repo = "flake-utils";
|
|
|
|
ref = "main";
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs = {
|
|
|
|
type = "github";
|
|
|
|
owner = "NixOS";
|
|
|
|
repo = "nixpkgs";
|
|
|
|
ref = "nixos-unstable";
|
|
|
|
};
|
|
|
|
|
|
|
|
pre-commit-hooks = {
|
|
|
|
type = "github";
|
|
|
|
owner = "cachix";
|
|
|
|
repo = "pre-commit-hooks.nix";
|
|
|
|
ref = "master";
|
|
|
|
inputs = {
|
|
|
|
flake-utils.follows = "futils";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, futils, nixpkgs, pre-commit-hooks }:
|
|
|
|
{
|
|
|
|
overlays = {
|
2023-05-03 16:48:36 +02:00
|
|
|
default = final: _prev: {
|
2023-04-04 17:48:04 +02:00
|
|
|
project = with final; stdenv.mkDerivation {
|
|
|
|
pname = "project";
|
|
|
|
version = "0.0.0";
|
|
|
|
|
|
|
|
src = self;
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = with pkgs; [
|
|
|
|
gtest
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A C++ project";
|
2024-03-28 21:20:41 +01:00
|
|
|
homepage = "https://git.belanyi.fr/ambroisie/project";
|
2023-04-04 17:48:04 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ambroisie ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} // futils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
self.overlays.default
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
pre-commit = pre-commit-hooks.lib.${system}.run {
|
|
|
|
src = self;
|
|
|
|
|
|
|
|
hooks = {
|
|
|
|
nixpkgs-fmt = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
clang-format = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
checks = {
|
|
|
|
inherit (self.packages.${system}) project;
|
|
|
|
|
|
|
|
inherit pre-commit;
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells = {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
inputsFrom = with self.packages.${system}; [
|
|
|
|
project
|
|
|
|
];
|
|
|
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
clang-tools
|
|
|
|
];
|
|
|
|
|
|
|
|
inherit (pre-commit) shellHook;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
packages = futils.lib.flattenTree {
|
|
|
|
default = pkgs.project;
|
|
|
|
inherit (pkgs) project;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|