move grub and nvidia modules to hardware

This commit is contained in:
smayzy
2025-07-07 19:24:11 +02:00
parent 1653ab916b
commit bfc760d7c4
4 changed files with 2 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.smayzy.grub-on-lap.enable = mkOption {
type = types.bool;
default = false;
description = "make grub works on this piece of shit laptop that can't boot normally";
};
config = {
boot.loader.systemd-boot.enable = false;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiInstallAsRemovable = mkIf config.smayzy.grub-on-lap.enable true;
boot.loader.efi.canTouchEfiVariables = mkIf (!config.smayzy.grub-on-lap.enable) true;
};
}
+21
View File
@@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption types;
in
{
options.smayzy.nvidia.enable = mkOption {
type = types.bool;
default = false;
description = "set to true if you want to use a nvidia GC";
};
config = mkIf config.smayzy.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
}