aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-05-30 23:11:07 -0300
committerEuAndreh <eu@euandre.org>2019-05-30 23:11:07 -0300
commite215d02457b5eb850109d43ab577c9e994fcbe7f (patch)
treec08a264de7a2d58d1563819a0e1a28ec948fd887 /nixos
parentMove shellCheck derivation to utils.nix (diff)
downloaddotfiles-e215d02457b5eb850109d43ab577c9e994fcbe7f.tar.gz
dotfiles-e215d02457b5eb850109d43ab577c9e994fcbe7f.tar.xz
Polish and use utils.fixme derivation
Diffstat (limited to 'nixos')
-rw-r--r--nixos/os-installation.sh1
-rw-r--r--nixos/utils.nix17
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:"