summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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