lol

nixos/uvesafb: init

Signed-off-by: lucasew <lucas59356@gmail.com>

lucasew d31cf8ca aa92a344

+40
+1
nixos/modules/module-list.nix
··· 1252 1252 ./system/boot/systemd/user.nix 1253 1253 ./system/boot/timesyncd.nix 1254 1254 ./system/boot/tmp.nix 1255 + ./system/boot/uvesafb.nix 1255 1256 ./system/etc/etc-activation.nix 1256 1257 ./tasks/auto-upgrade.nix 1257 1258 ./tasks/bcache.nix
+39
nixos/modules/system/boot/uvesafb.nix
··· 1 + { config, lib, pkgs, ... }: 2 + let 3 + cfg = config.boot.uvesafb; 4 + inherit (lib) mkIf mkEnableOption mkOption mdDoc types; 5 + in { 6 + options = { 7 + boot.uvesafb = { 8 + enable = mkEnableOption (mdDoc "uvesafb"); 9 + 10 + gfx-mode = mkOption { 11 + type = types.str; 12 + default = "1024x768-32"; 13 + description = mdDoc "Screen resolution in modedb format. See [uvesafb](https://docs.kernel.org/fb/uvesafb.html) and [modedb](https://docs.kernel.org/fb/modedb.html) documentation for more details. The default value is a sensible default but may be not ideal for all setups."; 14 + }; 15 + 16 + v86d.package = mkOption { 17 + type = types.package; 18 + description = mdDoc "Which v86d package to use with uvesafb"; 19 + defaultText = ''config.boot.kernelPackages.v86d.overrideAttrs (old: { 20 + hardeningDisable = [ "all" ]; 21 + })''; 22 + default = config.boot.kernelPackages.v86d.overrideAttrs (old: { 23 + hardeningDisable = [ "all" ]; 24 + }); 25 + }; 26 + }; 27 + }; 28 + config = mkIf cfg.enable { 29 + boot.initrd = { 30 + kernelModules = [ "uvesafb" ]; 31 + extraFiles."/usr/v86d".source = cfg.v86d.package; 32 + }; 33 + 34 + boot.kernelParams = [ 35 + "video=uvesafb:mode:${cfg.gfx-mode},mtrr:3,ywrap" 36 + ''uvesafb.v86d="${cfg.v86d.package}/bin/v86d"'' 37 + ]; 38 + }; 39 + }