Merge pull request #2283 from wizeman/u/sysctl-merge

nixos: Fix sysctl option merging
This commit is contained in:
Michael Raskin 2014-06-30 09:03:33 +04:00
commit f2e9ebbd46

View file

@ -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