summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2016-02-28 04:10:59 +0100
committertg(x) <*@tg-x.net>2016-02-28 04:10:59 +0100
commit38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95 (patch)
tree90fc9e43017f4697faaf0c2f98a7d07e9cac8c02 /nixos
parent4e3d6d3e90de85b610290af60ba374da20a2cc69 (diff)
downloadnixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.tar
nixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.tar.gz
nixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.tar.bz2
nixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.tar.lz
nixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.tar.xz
nixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.tar.zst
nixlib-38614d3f6ac0a071e4d9e4ee0a6faa1d517c3b95.zip
grsecurity: use kernel version instead of testing / stable
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/security/grsecurity.nix27
1 files changed, 5 insertions, 22 deletions
diff --git a/nixos/modules/security/grsecurity.nix b/nixos/modules/security/grsecurity.nix
index 40942644868a..ea739264a14b 100644
--- a/nixos/modules/security/grsecurity.nix
+++ b/nixos/modules/security/grsecurity.nix
@@ -26,19 +26,11 @@ in
         '';
       };
 
-      stable = mkOption {
-        type = types.bool;
-        default = false;
+      kernelPatch = mkOption {
+        type = types.attrs;
+        default = pkgs.kernelPatches.grsecurity_latest;
         description = ''
-          Enable the stable grsecurity patch, based on Linux 3.14.
-        '';
-      };
-
-      testing = mkOption {
-        type = types.bool;
-        default = false;
-        description = ''
-          Enable the testing grsecurity patch, based on Linux 4.0.
+          Grsecurity patch to use.
         '';
       };
 
@@ -219,16 +211,7 @@ in
 
   config = mkIf cfg.enable {
     assertions =
-      [ { assertion = cfg.stable || cfg.testing;
-          message   = ''
-            If grsecurity is enabled, you must select either the
-            stable patch (with kernel 3.14), or the testing patch (with
-            kernel 4.0) to continue.
-          '';
-        }
-        { assertion = !(cfg.stable && cfg.testing);
-          message   = "Select either one of the stable or testing patch";
-        }
+      [
         { assertion = (cfg.config.restrictProc -> !cfg.config.restrictProcWithGroup) ||
                       (cfg.config.restrictProcWithGroup -> !cfg.config.restrictProc);
           message   = "You cannot enable both restrictProc and restrictProcWithGroup";