nixos/uvesafb: init
Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
parent
aa92a34471
commit
d31cf8ca0c
2 changed files with 40 additions and 0 deletions
|
@ -1252,6 +1252,7 @@
|
|||
./system/boot/systemd/user.nix
|
||||
./system/boot/timesyncd.nix
|
||||
./system/boot/tmp.nix
|
||||
./system/boot/uvesafb.nix
|
||||
./system/etc/etc-activation.nix
|
||||
./tasks/auto-upgrade.nix
|
||||
./tasks/bcache.nix
|
||||
|
|
39
nixos/modules/system/boot/uvesafb.nix
Normal file
39
nixos/modules/system/boot/uvesafb.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.boot.uvesafb;
|
||||
inherit (lib) mkIf mkEnableOption mkOption mdDoc types;
|
||||
in {
|
||||
options = {
|
||||
boot.uvesafb = {
|
||||
enable = mkEnableOption (mdDoc "uvesafb");
|
||||
|
||||
gfx-mode = mkOption {
|
||||
type = types.str;
|
||||
default = "1024x768-32";
|
||||
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.";
|
||||
};
|
||||
|
||||
v86d.package = mkOption {
|
||||
type = types.package;
|
||||
description = mdDoc "Which v86d package to use with uvesafb";
|
||||
defaultText = ''config.boot.kernelPackages.v86d.overrideAttrs (old: {
|
||||
hardeningDisable = [ "all" ];
|
||||
})'';
|
||||
default = config.boot.kernelPackages.v86d.overrideAttrs (old: {
|
||||
hardeningDisable = [ "all" ];
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
boot.initrd = {
|
||||
kernelModules = [ "uvesafb" ];
|
||||
extraFiles."/usr/v86d".source = cfg.v86d.package;
|
||||
};
|
||||
|
||||
boot.kernelParams = [
|
||||
"video=uvesafb:mode:${cfg.gfx-mode},mtrr:3,ywrap"
|
||||
''uvesafb.v86d="${cfg.v86d.package}/bin/v86d"''
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue