From 3f0a49d46bb459eed2350a5d184fffa263fce3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 4 May 2024 20:59:17 +0200 Subject: [PATCH] [feature] flake.nix: reimplement removed checks --- flake.nix | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index daf46d0..000db46 100644 --- a/flake.nix +++ b/flake.nix @@ -64,13 +64,38 @@ { pkgs, system, - }: { + }: let + src = builtins.path { + path = ./.; + name = "configuration.nix"; + }; + in { nvim = nixvim.lib.${system}.check.mkTestDerivationFromNixvimModule { pkgs = import nixpkgs {inherit system overlays;}; module = ./nvim/nixvim.nix; }; - # alejandra = {}; - # typos = {}; + formatting = let + fmt = pkgs.lib.getExe self.formatter.${system}; + in + pkgs.stdenvNoCC.mkDerivation { + name = "nix-formatting-check"; + dontUnpack = true; + dontBuild = true; + doCheck = true; + checkPhase = "${fmt} --check ${src}"; + installPhase = "mkdir $out"; + }; + typos = let + typos = pkgs.lib.getExe pkgs.typos; + in + pkgs.stdenvNoCC.mkDerivation { + name = "typos-check"; + dontUnpack = true; + dontBuild = true; + doCheck = true; + checkPhase = "${typos} --color=always ${src}"; + installPhase = "mkdir $out"; + }; } );