refactor: make Orion sole transcription owner

This commit is contained in:
kiri committed 2026-09-06 02:29:00 +02:00
1 parent b38fb9e12a
commit 01c885589d
2 files changed
+4 -20

No files matched your search

+4 -19
View File
@@ -11,7 +11,6 @@ in
...
}:
let
isOrion = config.facts.machine.name == "orion";
modelName = "large-v3-turbo-q5_0";
modelHash = "sha256-OUIhcJzVrR9AxG5gMcphvOiJMebgiMGIKUxtWlX/p+I=";
modelSha256 = builtins.convertHash {
@@ -38,8 +37,7 @@ in
${builtins.readFile ./_diarize-transcript.py}
'';
};
whisper = if isOrion then pkgs.whisper-cpp else pkgs.whisper-cpp-vulkan;
acceleration = if isOrion then "CPU" else "Vulkan";
whisper = pkgs.whisper-cpp;
prepareDiarizationModel = pkgs.writeShellApplication {
name = "prepare-transcription-diarization-model";
runtimeInputs = with pkgs; [
@@ -104,7 +102,7 @@ in
Type = "oneshot";
ExecStart = lib.getExe transcribeRecordings;
Environment = [
"TRANSCRIBE_ENGINE_ACCELERATION=${acceleration}"
"TRANSCRIBE_ENGINE_ACCELERATION=CPU"
"TRANSCRIBE_ENGINE_VERSION=${whisper.version}"
"TRANSCRIBE_MODEL=${model}"
''"TRANSCRIBE_MODEL_NAME=${modelName} multilingual"''
@@ -116,16 +114,14 @@ in
"TRANSCRIBE_SETTLE_SECONDS=300"
"TRANSCRIBE_SYNC_ROOT=${home}/sync"
];
}
// lib.optionalAttrs isOrion {
Restart = "on-failure";
RestartSec = 60;
};
Install.WantedBy = lib.optionals isOrion [ "default.target" ];
Install.WantedBy = [ "default.target" ];
};
systemd.user.paths.transcribe-recordings = lib.mkIf isOrion {
systemd.user.paths.transcribe-recordings = {
Unit.Description = "Watch for synchronized recordings";
Path = {
@@ -135,17 +131,6 @@ in
Install.WantedBy = [ "paths.target" ];
};
systemd.user.timers.transcribe-recordings = lib.mkIf (!isOrion) {
Unit.Description = "Transcribe new recordings every two minutes";
Timer = {
OnCalendar = "*:0/2";
Persistent = true;
};
Install.WantedBy = [ "timers.target" ];
};
};
flake.modules.nixos.transcription =