sigil/nixos-modules/hardware/framebuffer.nix

45 lines
1.1 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
{
options.hardware.genode.framebuffer = {
enable = lib.mkEnableOption "framebuffer driver";
driver = mkOption {
type = types.enum [ "boot" "vesa" ];
default = "vesa";
};
};
config = {
genode.core.children.fb_drv =
mkIf config.hardware.genode.framebuffer.enable {
configFile = let
binary = with pkgs.genodePackages;
{
boot = boot_fb_drv;
vesa = vesa_drv;
}.${config.hardware.genode.framebuffer.driver};
in builtins.toFile "fb_drv.dhall" ''
let Sigil = env:DHALL_SIGIL
let Init = Sigil.Init
in λ(binary : Text)
Init.Child.flat
Init.Child.Attributes::{
, binary
, resources = Init.Resources::{ caps = 256, ram = Sigil.units.MiB 32 }
, routes =
[ Init.ServiceRoute.parent "IO_MEM"
, Init.ServiceRoute.parent "IO_PORT"
]
}
'';
};
};
}