From fda27a0da3c970c229892cfbc7159e7aaa21cd99 Mon Sep 17 00:00:00 2001 From: Henri Rosten Date: Mon, 18 Nov 2024 09:34:20 +0200 Subject: [PATCH] checks.nix: Refer flake root using self Signed-off-by: Henri Rosten --- nix/checks.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nix/checks.nix b/nix/checks.nix index 2f5e4c25..bc529262 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -1,19 +1,20 @@ # SPDX-FileCopyrightText: 2022-2024 TII (SSRC) and the Ghaf contributors # SPDX-License-Identifier: Apache-2.0 -_: { +{ self, ... }: +{ perSystem = { pkgs, ... }: { checks = { reuse = pkgs.runCommandLocal "reuse-lint" { buildInputs = [ pkgs.reuse ]; } '' - cd ${../.} + cd ${self.outPath} reuse lint touch $out ''; pycodestyle = pkgs.runCommandLocal "pycodestyle" { nativeBuildInputs = [ pkgs.python3.pkgs.pycodestyle ]; } '' - cd ${../.} + cd ${self.outPath} pycodestyle --max-line-length 90 $(find . -type f -name "*.py" ! -path "*result*" ! -path "*eggs*") touch $out ''; @@ -29,18 +30,18 @@ _: { ]; } '' - cd ${../.} + cd ${self.outPath} export HOME=/tmp pylint --enable=useless-suppression -rn $(find . -type f -name "*.py" ! -path "*result*" ! -path "*eggs*") touch $out ''; black = pkgs.runCommandLocal "black" { nativeBuildInputs = [ pkgs.python3.pkgs.black ]; } '' - cd ${../.} + cd ${self.outPath} black -q $(find . -type f -name "*.py" ! -path "*result*" ! -path "*eggs*") touch $out ''; terraform-fmt = pkgs.runCommandLocal "terraform-fmt" { nativeBuildInputs = [ pkgs.terraform ]; } '' - cd ${../.} + cd ${self.outPath} terraform fmt -check -recursive touch $out '';