nixos/immich: Add accelerationDevices configuration option

This allows immich to utilize devices for hardware accelerated video
transcoding.
This commit is contained in:
Torsten Trautwein
2025-02-03 08:03:49 +01:00
parent f92809dc01
commit c397110901
+13 -1
View File
@@ -20,7 +20,8 @@ let
NoNewPrivileges = true;
PrivateUsers = true;
PrivateTmp = true;
PrivateDevices = true;
PrivateDevices = cfg.accelerationDevices == [ ];
DeviceAllow = mkIf (cfg.accelerationDevices != null) cfg.accelerationDevices;
PrivateMounts = true;
ProtectClock = true;
ProtectControlGroups = true;
@@ -161,6 +162,17 @@ in
};
};
accelerationDevices = mkOption {
type = types.nullOr (types.listOf types.str);
default = [ ];
example = [ "/dev/dri/renderD128" ];
description = ''
A list of device paths to hardware acceleration devices that immich should
have access to. This is useful when transcoding media files.
The special value `[ ]` will disallow all devices using `PrivateDevices`. `null` will give access to all devices.
'';
};
database = {
enable =
mkEnableOption "the postgresql database for use with immich. See {option}`services.postgresql`"