nix flake

This commit is contained in:
bramderaeve
2026-05-05 03:16:10 +02:00
parent cb43446e86
commit f1158310dc
4 changed files with 151 additions and 0 deletions

50
flake.nix Normal file
View File

@@ -0,0 +1,50 @@
{
description = "NBT library and converter for C++17";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
inputs@{
flake-parts,
nixpkgs,
self,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
];
perSystem =
{ pkgs, self', ... }:
{
packages = {
nbt-cpp = pkgs.callPackage ./package.nix { };
default = self'.packages.nbt-cpp;
};
formatter = pkgs.writeShellApplication {
name = "nixfmt-nbt-cpp";
runtimeInputs = [
pkgs.nixfmt
];
text = ''
nixfmt flake.nix package.nix
'';
};
devShells.default = pkgs.mkShell {
inputsFrom = [
self'.packages.nbt-cpp
];
packages = with pkgs; [
cppcheck
];
};
};
};
}