Enable NVIDIA GPU support and Frigate TensorRT

Enable hardware.graphics, nvidia.open and nvidia-container-toolkit; set
xserver video driver to nvidia and enable nixpkgs.allowUnfree
Update Frigate container to stable-tensorrt, add nvidia GPU device,
mount model cache and add --privileged
Add lshw to system packages
This commit is contained in:
Stefan Kempinger 2026-01-21 11:38:34 +01:00
parent d065751bdb
commit 52d1afb99e

View file

@ -35,6 +35,13 @@
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
boot.zfs.forceImportRoot = false; boot.zfs.forceImportRoot = false;
hardware.graphics.enable = true;
hardware.nvidia.open = true;
hardware.nvidia-container-toolkit.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
# Console and locale # Console and locale
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
@ -113,6 +120,7 @@
smartmontools smartmontools
parted parted
borgbackup borgbackup
lshw
nil nil
]; ];
@ -231,7 +239,7 @@
# '' # ''
# ${lib.getExe cfg.package} admin user create --admin --email "root@localhost" --username crazychaoz --password temp123 || true # ${lib.getExe cfg.package} admin user create --admin --email "root@localhost" --username crazychaoz --password temp123 || true
# ''; # '';
# services.borgbackup.jobs."forgejo" = { # services.borgbackup.jobs."forgejo" = {
# paths = config.services.forgejo.repositoryRoot; # paths = config.services.forgejo.repositoryRoot;
@ -327,13 +335,18 @@
"frigate:/config" "frigate:/config"
"/run/dbus:/run/dbus:ro" "/run/dbus:/run/dbus:ro"
"/etc/localtime:/etc/localtime:ro" "/etc/localtime:/etc/localtime:ro"
"/root/frigate-models:/config/model_cache"
]; ];
environment.FRIGATE_RTSP_PASSWORD = "password123"; environment.FRIGATE_RTSP_PASSWORD = "password123";
# Note: The image will not be updated on rebuilds, unless the version label changes # Note: The image will not be updated on rebuilds, unless the version label changes
image = "ghcr.io/blakeblackshear/frigate:stable"; image = "ghcr.io/blakeblackshear/frigate:stable-tensorrt";
devices = [
"nvidia.com/gpu=all"
];
extraOptions = [ extraOptions = [
"--shm-size=512m" "--shm-size=512m"
"--network=host" "--network=host"
"--privileged"
]; ];
}; };
containers.netflow2ng = { containers.netflow2ng = {
@ -390,6 +403,9 @@
port = 8183; port = 8183;
}; };
nixpkgs.config.allowUnfree = true;
# Nix settings # Nix settings
nix.settings.experimental-features = [ nix.settings.experimental-features = [
"nix-command" "nix-command"