Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/adrastea: add nvidia for CUDA computing (not for display) #115

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/configurations/adrastea/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ pkgs, lib, ... }:

Check notice on line 5 in nixos/configurations/adrastea/default.nix

View workflow job for this annotation

GitHub Actions / nixf-tidy

variable will bind to this definition

note: var-bind-to-this

Check notice on line 5 in nixos/configurations/adrastea/default.nix

View workflow job for this annotation

GitHub Actions / nixf-tidy

variable will bind to this definition

note: var-bind-to-this

{
inclyc = {
Expand All @@ -21,6 +21,7 @@
./networking.nix
./vm.nix
./wireguard.nix
./nvidia.nix
];

boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ];
Expand Down Expand Up @@ -48,9 +49,9 @@
};
};

environment.systemPackages = with pkgs.libsForQt5; [

Check notice on line 52 in nixos/configurations/adrastea/default.nix

View workflow job for this annotation

GitHub Actions / nixf-tidy

escaping this with expression

note: escaping-this-with
ark
] ++ (with pkgs; [

Check warning on line 54 in nixos/configurations/adrastea/default.nix

View workflow job for this annotation

GitHub Actions / nixf-tidy

this variable will escape nested `with`, binding to static name

nixf-tidy detected warning on your code: sema-escaping-with

Check notice on line 54 in nixos/configurations/adrastea/default.nix

View workflow job for this annotation

GitHub Actions / nixf-tidy

escaping this with expression

note: escaping-this-with
gnumake
qemu
virt-viewer
Expand All @@ -71,7 +72,7 @@
lldb
llvmPackages_16.clang
llvmPackages_16.bintools
(lib.meta.hiPrio clang-tools_16)

Check warning on line 75 in nixos/configurations/adrastea/default.nix

View workflow job for this annotation

GitHub Actions / nixf-tidy

this variable will escape nested `with`, binding to static name

nixf-tidy detected warning on your code: sema-escaping-with
rr
ccache

Expand Down
2 changes: 0 additions & 2 deletions nixos/configurations/adrastea/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
# These modules are required for PCI passthrough, and must come before early modesetting stuff
boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" "kvm-intel" ];

boot.extraModprobeConfig = "options vfio-pci ids=10de:1f06,10de:10f9,10de:1ada,10de:1adb";
boot.extraModulePackages = [ ];

fileSystems."/" =
{
Expand Down
15 changes: 15 additions & 0 deletions nixos/configurations/adrastea/nvidia.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ config, ... }:
let
kernelPackages = config.boot.kernelPackages;
nvidia = kernelPackages.nvidia_x11;
in
{
# Provides kernel pacakges
boot.extraModulePackages = [ nvidia ];

# Provides nvidia-smi
environment.systemPackages = [ nvidia ];

# Set "NVIDIA_KERNEL" for furthur references.
environment.sessionVariables = { NVIDIA_KERNEL = nvidia; };
}
Loading