Changed layouts

This commit is contained in:
2025-09-18 12:39:26 +02:00
parent 8f52cfa599
commit 619b2dd888
11 changed files with 112 additions and 120 deletions

View File

@@ -1,26 +1,25 @@
{ config, lib, ... }:
let
inherit (lib) mkOption types;
let inherit (lib) mkOption types;
in {
options.bootMode = mkOption {
type = types.enum [ "uefi" "legacy" ];
default = "uefi";
};
options.bootMode = mkOption {
type = types.enum [ "uefi" "legacy" ];
default = "uefi";
};
config = {
boot.consoleLogLevel = 0;
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
config = {
boot.consoleLogLevel = 0;
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
boot.loader = if config.bootMode == "uefi" then {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
timeout = 0;
} else {
grub.enable = true;
grub.device = "/dev/sda";
timeout = 0;
};
};
boot.loader = {
timeout = 0;
} // (if config.bootMode == "uefi" then {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
} else {
grub.enable = true;
grub.device = "/dev/sda";
});
};
}

View File

@@ -1,26 +1,42 @@
{ config, ... }:
{ config, lib, pkgs, ... }:
{
hardware.graphics = { enable = true; };
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
let inherit (lib) mkOption types;
in {
options = {
enableCuda = mkOption {
type = types.bool;
default = false;
description = ''
Enable CUDA support for Blender and other packages.
Warning: This can cause very long build times.
'';
};
nvidiaOpen = mkOption {
type = types.bool;
default = false;
};
};
# Cuda for blender long build times
#environment.systemPackages = with pkgs; [
# (blender.override {
# cudaSupport = true;
# })
#];
config = {
hardware.graphics.enable = true;
# This causes very long build times
#nixpkgs.config.cudaSupport = true;
#hardware.enableAllFirmware = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
open = config.nvidiaOpen;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Apply CUDA-specific settings if enabled
nixpkgs.config.cudaSupport = config.enableCuda;
hardware.enableAllFirmware = config.enableCuda;
environment.systemPackages = (if config.enableCuda then
[ (pkgs.blender.override { cudaSupport = true; }) ]
else
[ ]);
};
}