This commit is contained in:
암냥 2026-08-16 20:03:47 +09:00
commit ab3a5296a0
No known key found for this signature in database
13 changed files with 199 additions and 50 deletions

View file

@ -1,18 +1,21 @@
{
pkgs,
inputs,
lib,
options,
...
}:
{
imports = [ inputs.nixcord.homeModules.nixcord ];
# imports = [ inputs.nixcord.nixosModules.nixcord ];
programs.nixcord = {
enable = true;
discord = {
branch = "stable";
branches = [ "stable" ];
# Electron's Vulkan backend crashes on the NVIDIA render node under
# native Wayland. Keep Wayland and hardware acceleration, but use GL.
commandLineArgs = [
"--use-gl=angle"
"--use-angle=gl"
];
vencord.enable = false;
equicord.enable = true;
krisp.enable = true;
@ -25,10 +28,4 @@
home.packages = with pkgs; [
discord-gamesdk
];
# home.activation.krispPatch = lib.mkIf (!pkgs.stdenv.isDarwin) (
# lib.hm.dag.entryAfter [ "writeBoundary" ] ''
# ${krisp-patcher}/bin/krisp-patcher $(${pkgs.findutils}/bin/find $HOME/.config/discord/ -name "discord_krisp.node" -path "*/modules/discord_krisp/*") || true
# ''
# );
}

View file

@ -2,6 +2,8 @@
{
programs.firefox = {
enable = true;
# Keep the pre-26.05 Home Manager location until the profile is migrated.
configPath = ".mozilla/firefox";
package = pkgs.firefox-devedition;
policies = {

80
modules/home/kdenlive.nix Normal file
View file

@ -0,0 +1,80 @@
{ 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.
kdenlivePython = pkgs.python3.withPackages (
pythonPackages: with pythonPackages; [
pip
numba
openai-whisper
srt
torch
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
'';
}