From a4711cad923d6c7480e596685d9dcaefa241fe3b Mon Sep 17 00:00:00 2001 From: sadbeast Date: Mon, 15 Apr 2024 18:08:28 -0700 Subject: initial mistake --- flake.nix | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..92f81f5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,59 @@ +{ + description = "tmz - a library for loading Tiled Maps and Tilesets"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + flake-parts.url = "github:hercules-ci/flake-parts"; + + devshell.url = "github:numtide/devshell"; + treefmt-nix.url = "github:numtide/treefmt-nix"; + }; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + imports = [ + inputs.devshell.flakeModule + inputs.treefmt-nix.flakeModule + ]; + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: { + treefmt.config = { + projectRootFile = "flake.nix"; + + flakeCheck = true; + flakeFormatter = true; + + programs.zig.enable = true; + programs.alejandra.enable = true; + }; + + devshells.default = { + commands = [ + { + name = "fmt"; + help = "format the repo"; + command = "nix fmt"; + } + { + name = "docs"; + help = "generate auto docs"; + command = "zig test -femit-docs src/tmz.zig"; + } + ]; + + packages = [ + pkgs.zig_0_12 + pkgs.kcov + ]; + }; + }; + }; +} -- cgit v1.2.3