137 lines
3.7 KiB
Nix
137 lines
3.7 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
{
|
|
imports = [
|
|
./aws.nix
|
|
./benchmarking.nix
|
|
./browsers.nix
|
|
./gaming.nix
|
|
./git.nix
|
|
./golang.nix
|
|
./graphics.nix
|
|
./helix.nix
|
|
./nixlang.nix
|
|
./notetaking.nix
|
|
./python.nix
|
|
./rust.nix
|
|
./shell.nix
|
|
./video-editing.nix
|
|
./media-playback.nix
|
|
./mpv.nix
|
|
];
|
|
|
|
xdg.enable = true;
|
|
home = {
|
|
sessionVariables = {
|
|
# these mfs pollute my home directory
|
|
# some unfixable offenders include .mozilla, .librewolf
|
|
# .adb and .ghidra
|
|
|
|
SCIKIT_LEARN_DATA = "${config.xdg.cacheHome}/sklearn-data";
|
|
CUDA_CACHE_PATH = "${config.xdg.cacheHome}/nv";
|
|
NH_FLAKE = "${config.xdg.userDirs.publicShare}/dotfiles";
|
|
GDBHISTFILE = "${config.xdg.dataHome}/gdb/history";
|
|
|
|
HISTFILE="${config.xdg.stateHome}/bash/history";
|
|
KERAS_HOME="${config.xdg.stateHome}/keras";
|
|
ANDROID_USER_HOME="${config.xdg.dataHome}/android";
|
|
W3M_DIR="${config.xdg.dataHome}/w3m";
|
|
|
|
# Remove when https://github.com/flxzt/rnote/issues/1543 gets fixed.
|
|
# causes the drawing tablet input to not get recognized.
|
|
GDK_BACKEND="x11";
|
|
|
|
GNUPGHOME = "${config.xdg.dataHome}/gnupg";
|
|
|
|
GOPATH = "${config.xdg.userDirs.publicShare}/go";
|
|
GOBIN = "${config.home.sessionVariables.GOPATH}/bin";
|
|
|
|
JUPYTER_PLATFORM_DIRS = "1";
|
|
|
|
_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java";
|
|
|
|
JULIAUP_DEPOT_PATH = "${config.xdg.dataHome}/julia";
|
|
CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
|
PSQL_HISTORY = "${config.xdg.stateHome}/psql_history";
|
|
PYTHON_HISTORY = "${config.xdg.stateHome}/python_history";
|
|
SQLITE_HISTORY="${config.xdg.stateHome}/sqlite_history";
|
|
};
|
|
|
|
sessionPath = [
|
|
config.home.sessionVariables.GOBIN
|
|
"${config.home.homeDirectory}/.cargo/bin"
|
|
];
|
|
stateVersion = "24.05";
|
|
|
|
packages = with pkgs; [
|
|
kiwix
|
|
kiwix-tools
|
|
harper
|
|
tesseract
|
|
whisper-cpp
|
|
signal-desktop
|
|
|
|
(pkgs.writeShellScriptBin "lecture" ''
|
|
mpv --speed=1.5 --start=00:00:14 --cache-pause-wait=14 --script-opts='skipsilence-enabled=yes,skipsilence-threshold_db=-18' --vf=sub,negate "$1"
|
|
'')
|
|
(pkgs.writeShellScriptBin "transcribe" ''
|
|
MODEL=$1
|
|
WAVFILE="/tmp/whisper.wav"
|
|
|
|
if test ! -f "$WAVFILE"; then
|
|
${pkgs.notify-desktop}/bin/notify-desktop "Recording audio" "Re-trigger the shortcut to transcribe"
|
|
nohup pw-record $WAVFILE &
|
|
disown -a
|
|
exit
|
|
fi
|
|
|
|
${pkgs.busybox}/bin/fuser -k -INT "$WAVFILE"
|
|
${pkgs.notify-desktop}/bin/notify-desktop "Starting transcription" "using model $MODEL"
|
|
${pkgs.whisper-cpp}/bin/whisper-cli -m "$MODEL" -f "$WAVFILE" --output-txt
|
|
cat /tmp/whisper.wav.txt | wl-copy
|
|
rm "$WAVFILE"
|
|
${pkgs.notify-desktop}/bin/notify-desktop "Transcription finished" "You may paste from the clipboard"
|
|
'')
|
|
];
|
|
};
|
|
|
|
programs = {
|
|
direnv = {
|
|
enable = true;
|
|
nix-direnv.enable = true;
|
|
};
|
|
|
|
zoxide = {
|
|
enable = true;
|
|
enableFishIntegration = true;
|
|
};
|
|
|
|
kitty = {
|
|
enable = true;
|
|
settings = {
|
|
confirm_os_window_close = 0;
|
|
enable_audio_bell = false;
|
|
window_padding_width = "6 10";
|
|
cursor_shape = "block";
|
|
cursor_trail = 1;
|
|
cursor_trail_decay = "0.1 0.3";
|
|
cursor_trail_start_threshold = 0;
|
|
shell_integration = "no-cursor";
|
|
font_size = 13.0;
|
|
tab_bar_margin_height = "8.0 0.0";
|
|
tab_bar_style = "powerline";
|
|
tab_powerline_style = "slanted";
|
|
};
|
|
keybindings = {
|
|
"ctrl+t" = "new_tab_with_cwd";
|
|
"ctrl+shift+t" = "";
|
|
"ctrl+backspace" = "send_text all \\x17";
|
|
};
|
|
};
|
|
};
|
|
}
|