nix flake
This commit is contained in:
50
flake.nix
Normal file
50
flake.nix
Normal 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
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user