From e215d02457b5eb850109d43ab577c9e994fcbe7f Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 30 May 2019 23:11:07 -0300 Subject: Polish and use utils.fixme derivation --- nixos/os-installation.sh | 1 - nixos/utils.nix | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'nixos') diff --git a/nixos/os-installation.sh b/nixos/os-installation.sh index 0936f94..519ee5a 100644 --- a/nixos/os-installation.sh +++ b/nixos/os-installation.sh @@ -24,7 +24,6 @@ systemctl start display-manager # Change keyboard to pt_BR layout: loadkeys br-abnt2 -# FIXME: make it declarative # Format disk: gdisk /dev/nvme0n1 # disk found using lsblk diff --git a/nixos/utils.nix b/nixos/utils.nix index 30110a4..4a1b8fd 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -40,24 +40,27 @@ in rec { touch $out ''; }); - - fixme = baseTask.overrideAttrs (baseAttrs: { + fixme = ignoredFiles: + baseTask.overrideAttrs (baseAttrs: rec { name = "${baseAttrs.name}-fixme"; buildInputs = baseAttrs.buildInputs ++ [ pkgs.ag ]; + ignoredPattern = pkgs.lib.fold (a: b: " --ignore ${a} ${b}") "" + (if ignoredFiles == null then [ + "default.nix" + "TODOs.org" + ] else + ignoredFiles); buildPhase = '' - ag FIXME --ignore default.nix || { + ag FIXME ${ignoredPattern} || { touch $out exit 0 } - echo "^^^^^^^^^^^^^^^^^" - echo " Found dangling FIXME markers on the project xp" + echo " Found dangling FIXME markers on the project." exit 1 ''; }); - test = testDerivations: baseTask.overrideAttrs (baseAttrs: { - name = "${baseAttrs.name}-test"; buildPhase = '' echo "Ran tests for:" -- cgit v1.2.3