mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-14 04:37:17 +00:00
Compare commits
No commits in common. "130fdae4bffd5f726ed90c0b17213e4275792dbb" and "53771e154707c848ebd30f3ac2bf44e9a6e266b0" have entirely different histories.
130fdae4bf
...
53771e1547
|
@ -56,7 +56,6 @@
|
||||||
virtual-machine = false;
|
virtual-machine = false;
|
||||||
};
|
};
|
||||||
cpu.type = "intel";
|
cpu.type = "intel";
|
||||||
gpu.type = "nvidia";
|
|
||||||
hasTPM = true;
|
hasTPM = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
gpu.type = mkOption {
|
|
||||||
type = with types; nullOr (enum [ "nvidia" "amd" "intel" ]);
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
The manifaturer/type of the primary system GPU.
|
|
||||||
|
|
||||||
Allows the correct GPU drivers to be loaded, potentially optimizing video output performance.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
hasTPM = mkOption {
|
hasTPM = mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
_: {
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./cpu
|
./cpu
|
||||||
./gpu
|
|
||||||
./tpm.nix
|
./tpm.nix
|
||||||
./generic.nix
|
./generic.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
# WARNING: This file is currently untested
|
|
||||||
# (I didn't yet run this NixOS config on any AMD GPU systems)
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
dev = config.myOptions.device;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = lib.mkIf (dev.gpu.type == "amd") {
|
|
||||||
services.xserver.videoDrivers = lib.mkDefault ["modesetting" "amdgpu"];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
initrd.kernelModules = ["amdgpu"]; # load amdgpu kernel module as early as initrd
|
|
||||||
kernelModules = ["amdgpu"]; # if loading somehow fails during initrd but the boot continues, try again later
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
mesa
|
|
||||||
|
|
||||||
vulkan-tools
|
|
||||||
vulkan-loader
|
|
||||||
vulkan-validation-layers
|
|
||||||
vulkan-extension-layer
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enable OpenGL
|
|
||||||
hardware.opengl = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Enable OpenCL and AMDVLK
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
amdvlk
|
|
||||||
rcomPackages.clr.icd
|
|
||||||
];
|
|
||||||
extraPackages32 = with pkgs; [
|
|
||||||
driversi686Linux.amdvlk
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
_: {
|
|
||||||
imports = [
|
|
||||||
./amd.nix
|
|
||||||
./nvidia.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
dev = config.myOptions.device;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = lib.mkIf (dev.gpu.type == "nvidia") {
|
|
||||||
# Nvidia drivers are unfree software
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# Enable nvidia driver for Xorg and Wayland
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
|
|
||||||
hardware = {
|
|
||||||
nvidia = {
|
|
||||||
# modeestting is required
|
|
||||||
modesetting.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Nvidia power managerment. Experimental, and can cause sleep/suspend to fail.
|
|
||||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
|
||||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead of just
|
|
||||||
# the bare essentials
|
|
||||||
powerManagement.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Fine-grained power management. Turns off GPU when not in use.
|
|
||||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer)
|
|
||||||
powerManagement.finegrained = lib.mkDefault false;
|
|
||||||
|
|
||||||
# Use the NVidia open source kernel module (not to be confused with the
|
|
||||||
# independent third-party "nouveau" open source driver).
|
|
||||||
# Support is limited to the Turing and later architectures. Full list of
|
|
||||||
# supported GPUs is at: https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
|
||||||
#
|
|
||||||
# Enable this by default, hosts may override this option if their gpu is not
|
|
||||||
# supported by the open source drivers
|
|
||||||
open = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Add the Nvidia settings package, accessible via `nvidia-settings`.
|
|
||||||
# (useless on NixOS)
|
|
||||||
nvidiaSettings = false;
|
|
||||||
|
|
||||||
# This ensures all GPUs stay awake even during headless mode.
|
|
||||||
nvidiaPersistenced = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable OpenGL
|
|
||||||
opengl = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# VA-API implementation using NVIDIA's NVDEC
|
|
||||||
extraPackages = with pkgs; [nvidia-vaapi-driver];
|
|
||||||
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# blacklist nouveau module so that it does not conflict with nvidia drm stuff
|
|
||||||
# also the nouveau performance is horrible in comparison.
|
|
||||||
boot.blacklistedKernelModules = ["nouveau"];
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
systemPackages = with pkgs; [
|
|
||||||
mesa
|
|
||||||
|
|
||||||
vulkan-tools
|
|
||||||
vulkan-loader
|
|
||||||
vulkan-validation-layers
|
|
||||||
vulkan-extension-layer
|
|
||||||
|
|
||||||
libva
|
|
||||||
libva-utils
|
|
||||||
];
|
|
||||||
|
|
||||||
sessionVariables = {
|
|
||||||
LIBVA_DRIVER_NAME = "nvidia";
|
|
||||||
WLR_NO_HARDWARE_CURSORS = "1";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -8,6 +8,13 @@ in
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
|
# Prevent mutating users outside of our configurations.
|
||||||
|
# TODO: Solve this, currentry it fails with no password
|
||||||
|
# specified for root account nor any whell user accounts
|
||||||
|
# and wants us to set pw manually with passwd, which needs
|
||||||
|
# mutableUsers
|
||||||
|
#mutableUsers = false;
|
||||||
|
|
||||||
users.${cfg.username} = {
|
users.${cfg.username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
|
|
Loading…
Reference in a new issue