linux: convert hardened-config to a structured one

This commit is contained in:
Matthieu Coudron
2018-10-03 18:53:23 +09:00
parent 3bb7b3f02e
commit 7aacbdb898
5 changed files with 83 additions and 111 deletions

View File

@@ -1,7 +1,12 @@
{ lib }:
{ lib, version }:
with lib;
rec {
# Common patterns/legacy
whenAtLeast = ver: mkIf (versionAtLeast version ver);
whenOlder = ver: mkIf (versionOlder version ver);
# range is (inclusive, exclusive)
whenBetween = verLow: verHigh: mkIf (versionAtLeast version verLow && versionOlder version verHigh);
# Keeping these around in case we decide to change this horrible implementation :)