All checks were successful
Nix Format Check / check-format (push) Successful in 37s
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
/etc/nixos/hardware-configuration.nix
|
|
./mennos-server/zfs.nix
|
|
];
|
|
|
|
networking.hostName = "mennos-server";
|
|
networking.hostId = "64519940";
|
|
|
|
# Bootloader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
# Allow unfree packages
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
# Load nvidia driver for Xorg and Wayland
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
# Enable opengl and 32-bit support
|
|
hardware.opengl = {
|
|
enable = true;
|
|
driSupport = true;
|
|
driSupport32Bit = true;
|
|
};
|
|
|
|
# nvtop, a system monitor for GPUs
|
|
environment.systemPackages = with pkgs; [ nvtopPackages.nvidia ];
|
|
|
|
# Enable NVIDIA Docker support
|
|
# test with: $ docker run --rm -it --device=nvidia.com/gpu=all ubuntu:latest nvidia-smi
|
|
hardware.nvidia-container-toolkit.enable = true;
|
|
virtualisation.docker = {
|
|
enable = true;
|
|
};
|
|
|
|
hardware.nvidia = {
|
|
modesetting.enable = true;
|
|
powerManagement.enable = false;
|
|
powerManagement.finegrained = false;
|
|
open = false;
|
|
nvidiaSettings = true;
|
|
|
|
# Use the latest driver from the unstable channel
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
};
|
|
}
|