From 7f1b03295a3e4eafbf11af4bd7e372f0e316fc0f Mon Sep 17 00:00:00 2001 From: Norbert Melzer Date: Tue, 5 Apr 2022 17:15:13 +0200 Subject: [PATCH] add alejandra check --- checks/alejandra.nix | 8 ++++++++ checks/default.nix | 9 +++++++++ flake.nix | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 checks/alejandra.nix create mode 100644 checks/default.nix diff --git a/checks/alejandra.nix b/checks/alejandra.nix new file mode 100644 index 00000000..7edf9921 --- /dev/null +++ b/checks/alejandra.nix @@ -0,0 +1,8 @@ +{ + runCommandNoCC, + alejandra, + self, +}: +runCommandNoCC "alejandra-run-${self.rev or "00000000"}" {} '' + ${alejandra}/bin/alejandra --check ${self} < /dev/null +'' diff --git a/checks/default.nix b/checks/default.nix new file mode 100644 index 00000000..b750cb78 --- /dev/null +++ b/checks/default.nix @@ -0,0 +1,9 @@ +inputs: let + pkgs = inputs.unstable.legacyPackages.x86_64-linux; + apkgs = inputs.alejandra.packages.x86_64-linux; + spkgs = inputs.statix.packages.x86_64-linux; + + callPackage = pkgs.lib.callPackageWith (pkgs // apkgs // spkgs // {inherit (inputs) self;}); +in { + alejandra = callPackage ./alejandra.nix {}; +} diff --git a/flake.nix b/flake.nix index fdf8c4f3..5764054c 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ // self.lib.nixosConfigurationsAsPackages.x86_64-linux // self.lib.homeConfigurationsAsPackages.x86_64-linux; - checks = self.packages; + checks.x86_64-linux = import ./checks inputs; lib = import ./lib inputs; -- 2.51.2