about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2014-06-30 09:03:33 +0400
committerMichael Raskin <7c6f434c@mail.ru>2014-06-30 09:03:33 +0400
commitf2e9ebbd46e4026d760118701c6decf01b50f024 (patch)
tree5b230ff64635587b395f66f3c795c6f3cf94b80a /nixos
parent0ecfc6cb49d80451f8944913ff51b55ca2151430 (diff)
parentd8b21c22245af2d6a6582df3290921ac5ca26235 (diff)
downloadnixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.tar
nixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.tar.gz
nixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.tar.bz2
nixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.tar.lz
nixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.tar.xz
nixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.tar.zst
nixlib-f2e9ebbd46e4026d760118701c6decf01b50f024.zip
Merge pull request #2283 from wizeman/u/sysctl-merge
nixos: Fix sysctl option merging
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/sysctl.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixos/modules/config/sysctl.nix b/nixos/modules/config/sysctl.nix
index 542360219193..3b6ccd380c75 100644
--- a/nixos/modules/config/sysctl.nix
+++ b/nixos/modules/config/sysctl.nix
@@ -6,8 +6,12 @@ let
 
   sysctlOption = mkOptionType {
     name = "sysctl option value";
-    check = x: isBool x || isString x || isInt x || isNull x;
-    merge = args: defs: (last defs).value; # FIXME: hacky way to allow overriding in configuration.nix.
+    check = val:
+      let
+        checkType = x: isBool x || isString x || isInt x || isNull x;
+      in
+        checkType val || (val._type or "" == "override" && checkType val.content);
+    merge = loc: defs: mergeOneOption loc (filterOverrides defs);
   };
 
 in