nixos/immich: Add accelerationDevices configuration option
This allows immich to utilize devices for hardware accelerated video transcoding.
This commit is contained in:
@@ -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`"
|
||||
|
||||
Reference in New Issue
Block a user