From 3b268cea980b7f29247f640fc4e8923d0d373046 Mon Sep 17 00:00:00 2001 From: imnyang Date: Thu, 10 Sep 2026 02:04:43 +0900 Subject: [PATCH] wow --- hosts/machine/ena/home/packages.nix | 1 + hosts/machine/mizuki/home/default.nix | 1 - hosts/machine/mizuki/home/packages.nix | 2 + modules/home/kdenlive.nix | 94 -------------------------- 4 files changed, 3 insertions(+), 95 deletions(-) delete mode 100644 modules/home/kdenlive.nix diff --git a/hosts/machine/ena/home/packages.nix b/hosts/machine/ena/home/packages.nix index 97c67f9..738d708 100644 --- a/hosts/machine/ena/home/packages.nix +++ b/hosts/machine/ena/home/packages.nix @@ -9,5 +9,6 @@ with pkgs; # inputs.waterfox.packages.${pkgs.system}.waterfox gnome-network-displays element-desktop + inputs.imnyang.packages.${pkgs.system}.figma-linux # hoffice ] diff --git a/hosts/machine/mizuki/home/default.nix b/hosts/machine/mizuki/home/default.nix index 42043ac..c1ca124 100644 --- a/hosts/machine/mizuki/home/default.nix +++ b/hosts/machine/mizuki/home/default.nix @@ -34,7 +34,6 @@ ./config/plasma.nix "${inputs.self}/modules/home/discord/linux.nix" "${inputs.self}/modules/home/obs-studio.nix" - "${inputs.self}/modules/home/kdenlive.nix" "${inputs.self}/modules/home/devtool/vscode.nix" "${inputs.self}/modules/home/ssh.nix" ]; diff --git a/hosts/machine/mizuki/home/packages.nix b/hosts/machine/mizuki/home/packages.nix index 1d80525..9955c0f 100644 --- a/hosts/machine/mizuki/home/packages.nix +++ b/hosts/machine/mizuki/home/packages.nix @@ -20,6 +20,8 @@ with pkgs; vrc-get vrcvideocacher + inputs.imnyang.packages.${pkgs.system}.figma-linux + # waterfox-bin # inputs.waterfox.packages.${pkgs.system}.waterfox ] diff --git a/modules/home/kdenlive.nix b/modules/home/kdenlive.nix deleted file mode 100644 index 536da28..0000000 --- a/modules/home/kdenlive.nix +++ /dev/null @@ -1,94 +0,0 @@ -{ lib, pkgs, ... }: -let - pythonPackages = pkgs.python3Packages; - - # Vosk is not present in the current nixpkgs revision, although it is one - # of the backends shipped with Kdenlive. Package its upstream manylinux - # wheel until it is available from nixpkgs. - vosk = pythonPackages.buildPythonPackage rec { - pname = "vosk"; - version = "0.3.45"; - format = "wheel"; - - src = pkgs.fetchPypi { - inherit pname version format; - python = "py3"; - dist = "py3"; - platform = "manylinux_2_12_x86_64.manylinux2010_x86_64"; - hash = "sha256-JeAlCTxDmdcnj1Q1aO2MxUYKw6S/SMI2c6zh4l0mYZ8="; - }; - - # The upstream wheel bundles libvosk.so without an RPATH. Patch it to - # the Nix C++ runtime so importing vosk works outside a FHS environment. - nativeBuildInputs = [ pkgs.autoPatchelfHook ]; - buildInputs = [ pkgs.stdenv.cc.cc.lib ]; - - propagatedBuildInputs = with pythonPackages; [ - cffi - srt - requests - tqdm - websockets - ]; - - meta = with pkgs.lib; { - description = "Offline open source speech recognition toolkit"; - homepage = "https://alphacephei.com/vosk/"; - license = licenses.asl20; - }; - }; - - # Kdenlive's speech-to-text scripts are launched through - # /usr/bin/env python3. Keep this environment private to Kdenlive so the - # other Python environments installed on the system remain independent. - cudaPackages = pkgs.cudaPackages_13_0; - cudaBindings = pythonPackages.cuda-bindings.override { inherit cudaPackages; }; - torchCuda = pythonPackages.torch-bin.override { - inherit cudaPackages; - cuda-bindings = cudaBindings; - }; - whisperCuda = pythonPackages.openai-whisper.override { - torch = torchCuda; - triton = pythonPackages.triton-bin; - }; - kdenlivePython = pkgs.python3.withPackages ( - pythonPackages: with pythonPackages; [ - pip - numba - whisperCuda - srt - torchCuda - vosk - ] - ); - - kdenlive = pkgs.kdePackages.kdenlive.overrideAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ]; - postFixup = (old.postFixup or "") + '' - wrapProgram $out/bin/kdenlive \ - --prefix PATH : ${kdenlivePython}/bin \ - --set PYTHONNOUSERSITE 1 - ''; - }); -in -{ - home.packages = [ kdenlive ]; - - # Kdenlive otherwise prefers its mutable ~/.local/share/kdenlive/venv. - # That venv was created by pip and its native Torch libraries do not have - # the Nix runtime paths. Point Kdenlive at the immutable environment above. - home.activation.kdenliveSpeechPython = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run ${pkgs.kdePackages.kconfig}/bin/kwriteconfig6 \ - --file "$HOME/.config/kdenliverc" \ - --group speech \ - --key speech_system_python true - run ${pkgs.kdePackages.kconfig}/bin/kwriteconfig6 \ - --file "$HOME/.config/kdenliverc" \ - --group speech \ - --key speech_system_python_path ${kdenlivePython}/bin/python3 - run ${pkgs.kdePackages.kconfig}/bin/kwriteconfig6 \ - --file "$HOME/.config/kdenliverc" \ - --group speech \ - --key whisperDevice cuda - ''; -}