Unverified Commit 1d2e4381 authored by Robert Schütz's avatar Robert Schütz Committed by GitHub
Browse files

nixos/immich: Add accelerationDevices config option for hardware acceleration (#376339)

parents e8f16815 c3971109
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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`"