95 lines
2.9 KiB
Nix
95 lines
2.9 KiB
Nix
{ pkgs, ... }@all: with all; let
|
|
grub-theme-ascii-diana = (pkgs.fetchFromGitea {
|
|
domain = "git.${hyper.domain}";
|
|
owner = "nx2";
|
|
repo = "grub-theme-ascii-diana";
|
|
rev = "0.5.0";
|
|
hash = "sha256-e+55NYsSsWY6GPbYUtdVEB9krueuCAWT3Ce/Ghops1g=";
|
|
});
|
|
device-boot = if hyper.host == "NxNORTH" then {
|
|
kernelPackages = pkgs.linuxPackages_zen;
|
|
kernelParams = [
|
|
# "fbcon=margin:1"
|
|
"fbcon=nodefer"
|
|
"video=DP-4:2560x1440@60"
|
|
# "video=HDMI-A-3:d"
|
|
];
|
|
lanzaboote = {
|
|
enable = true;
|
|
pkiBundle = "/var/lib/sbctl";
|
|
};
|
|
loader.systemd-boot = {
|
|
enable = false; # let lanzaboote install systemd-boot
|
|
consoleMode = "max";
|
|
configurationLimit = 10;
|
|
};
|
|
} else if hyper.host == "NxXPS" then {
|
|
kernelPackages = pkgs.linuxPackages;
|
|
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
|
kernelModules = [ "v4l2loopback" ];
|
|
extraModprobeConfig = ''
|
|
options v4l2loopback devices=1 video_nr=1 card_label="OBS VCam" exclusive_caps=1
|
|
options snd_hda_intel power_save=0
|
|
options snd_ac97_codec power_save=0
|
|
'';
|
|
loader = {
|
|
efi.canTouchEfiVariables = true;
|
|
grub = {
|
|
enable = true;
|
|
configurationLimit = 30;
|
|
device = "nodev";
|
|
# useOSProber = true;
|
|
efiSupport = true;
|
|
theme = grub-theme-ascii-diana;
|
|
font = "${grub-theme-ascii-diana}/unicode.pf2";
|
|
fontSize = 50;
|
|
extraEntries = ''
|
|
menuentry 'Windows 11' --class windows --class os $menuentry_id_option 'osprober-efi-0A97-7A2D' {
|
|
insmod part_gpt
|
|
insmod fat
|
|
search --no-floppy --fs-uuid --set=root 0A97-7A2D
|
|
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
|
}
|
|
'';
|
|
};
|
|
};
|
|
} else if hyper.host == "NxACE" then {
|
|
kernelPackages = pkgs.linuxPackages_6_12;
|
|
loader = {
|
|
efi.canTouchEfiVariables = true;
|
|
grub = {
|
|
enable = true;
|
|
device = "nodev";
|
|
devices = [];
|
|
efiSupport = true;
|
|
};
|
|
};
|
|
} else assert 1 == "Unknown host"; {};
|
|
in {
|
|
imports = if hyper.host == "NxNORTH" then [
|
|
inputs.lanzaboote.nixosModules.lanzaboote
|
|
] else [];
|
|
config = {
|
|
environment.systemPackages = with pkgs; lib.mkIf ( host == "NxNORTH" ) [ sbctl ];
|
|
boot = { tmp.useTmpfs = false; } // device-boot;
|
|
# thx fxzzi
|
|
# sh*tty nvidia makes the tty on my 1440p monitor 1080p
|
|
# so just resize it to 1440p
|
|
systemd.services.fbset = lib.mkIf (hyper.host == "NxNORTH") {
|
|
enable = true;
|
|
wantedBy = ["multi-user.target"];
|
|
unitConfig = {
|
|
Description = "Set framebuffer resolution";
|
|
Before = "display-manager.service";
|
|
};
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = "${lib.getExe pkgs.fbset} -xres 2560 -yres 1440 -match --all";
|
|
RemainAfterExit = "yes";
|
|
StandardOutput = "journal";
|
|
StandardError = "journal";
|
|
};
|
|
};
|
|
};
|
|
}
|