{ flake.nixosModules.ntsync = { config, lib, ... }: let cfg = config.hive.ntsync; in { options.hive.ntsync.enable = lib.mkEnableOption "Enable the nt-sync kernel driver."; options.hive.ntsync.proton = lib.mkOption { description = "Make proton use ntsync"; default = true; type = lib.types.bool; }; config = lib.mkIf cfg.enable { assertions = [ { assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.14"; message = "ntsync requires at least linux 6.14"; } ]; boot.kernelModules = ["ntsync"]; environment.variables = lib.optionalAttrs cfg.proton { PROTON_USE_NTSYNC = 1; }; }; }; }