diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-21 12:47:29 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-21 12:47:29 +0200 |
commit | 61997911557fa8da66598ec54f5f280e1be1dd5d (patch) | |
tree | 4baf547d438fe92dc49ef44bba56371b460ee28e /flake.nix | |
parent | docs(NEWS): Add (diff) | |
download | yt-61997911557fa8da66598ec54f5f280e1be1dd5d.tar.gz yt-61997911557fa8da66598ec54f5f280e1be1dd5d.zip |
build(flake): Setup up checks (formatter and derivation)
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix index 5413444..2c79390 100644 --- a/flake.nix +++ b/flake.nix @@ -14,12 +14,19 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; }; outputs = { self, nixpkgs, flake-utils, + treefmt-nix, }: (flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages."${system}"; @@ -35,7 +42,18 @@ nativeBuildInputs = with pkgs; [ llvmPackages_latest.clang-unwrapped.lib ]; + + yt = pkgs.callPackage ./package.nix {}; + + treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; in { + checks = { + inherit yt; + formatting = treefmtEval.config.build.check self; + }; + + formatter = treefmtEval.config.build.wrapper; + devShells.default = pkgs.mkShell { env = let clang_version = |