1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 05:21:47 +03:00
mobile-nixos/modules/quirks/framebuffer.nix

50 lines
1.1 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.mobile.quirks;
in
{
options.mobile = {
quirks.fb-refresher.enable = mkOption {
type = types.bool;
default = false;
2020-04-07 00:58:20 +03:00
description = ''
Enables use of `msm-fb-refresher`.
Use sparingly, it is better to patch software to flip buffers instead.
Note that while it was written for Qualcomm devices, this workaround
may be useful for other vendors too.
2020-04-07 00:58:20 +03:00
'';
};
};
config = mkMerge [
{
mobile.boot = mkMerge [
(mkIf cfg.fb-refresher.enable {
stage-1 = {
extraUtils = with pkgs; [
msm-fb-refresher
];
tasks = [ ./msm-fb-refresher-task.rb ];
};
})
];
}
(mkIf cfg.fb-refresher.enable {
systemd.services.fb-refresher = {
description = "Workaround for devices not automatically flipping buffers stuff.";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.msm-fb-refresher}/bin/msm-fb-refresher --loop
'';
};
};
})
];
}