diff options
author | EuAndreh <eu@euandre.org> | 2019-05-30 23:11:07 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-05-30 23:11:07 -0300 |
commit | e215d02457b5eb850109d43ab577c9e994fcbe7f (patch) | |
tree | c08a264de7a2d58d1563819a0e1a28ec948fd887 /nixos | |
parent | Move shellCheck derivation to utils.nix (diff) | |
download | dotfiles-e215d02457b5eb850109d43ab577c9e994fcbe7f.tar.gz dotfiles-e215d02457b5eb850109d43ab577c9e994fcbe7f.tar.xz |
Polish and use utils.fixme derivation
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/os-installation.sh | 1 | ||||
-rw-r--r-- | nixos/utils.nix | 17 |
2 files changed, 10 insertions, 8 deletions
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:" |