refactor os configurations
All checks were successful
Build iso when a new version is pushed / test (push) Successful in 2m10s
All checks were successful
Build iso when a new version is pushed / test (push) Successful in 2m10s
This commit is contained in:
@ -1,19 +1,65 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# nvidia.nix :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/09/05 23:47:19 by tomoron #+# #+# #
|
||||
# Updated: 2025/09/06 01:12:34 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
{ config, lib, inputs, pkgs, ... }:
|
||||
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.mods.nvidia-graphics.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "enable my nvidia graphics settings";
|
||||
options.mods.nvidia = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "enable nvidia drivers";
|
||||
};
|
||||
beta = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "use beta version of the drivers";
|
||||
};
|
||||
open = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "use beta version of the drivers";
|
||||
};
|
||||
containerToolkit = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "enable the nvidia container toolkit (gpu in docker)";
|
||||
};
|
||||
prime = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "enable nvidia prime offload (saves battery)";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.nvidia-graphics.enable {
|
||||
config = lib.mkIf config.mods.nvidia.enable {
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
hardware.nvidia = {
|
||||
package = lib.mkIf config.mods.nvidia.beta config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = config.mods.nvidia.open;
|
||||
|
||||
prime.offload = lib.mkIf config.mods.nvidia.prime {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware.nvidia-container-toolkit.enable = config.mods.nvidia.containerToolkit;
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user