clean up
This commit is contained in:
parent
9b7f421616
commit
e754a9c329
3 changed files with 0 additions and 131 deletions
|
|
@ -1,69 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# Create dictionary setup script that downloads and extracts dictionaries
|
|
||||||
setupDictionaries = pkgs.writeShellScript "setup-dictionaries" ''
|
|
||||||
# Create dictionary directory
|
|
||||||
mkdir -p "$HOME/.stardict/dic"
|
|
||||||
|
|
||||||
# Function to download and extract dictionary
|
|
||||||
download_dict() {
|
|
||||||
local url="$1"
|
|
||||||
local filename="$2"
|
|
||||||
local extract_dir="$HOME/.stardict/dic"
|
|
||||||
|
|
||||||
if [ ! -f "$extract_dir/.$(basename $filename)-extracted" ]; then
|
|
||||||
echo "Downloading $filename..."
|
|
||||||
if ${pkgs.curl}/bin/curl -L -o "/tmp/$filename" "$url"; then
|
|
||||||
echo "Extracting $filename..."
|
|
||||||
${pkgs.gnutar}/bin/tar -xf "/tmp/$filename" -C "$extract_dir" --strip-components=1 2>/dev/null || \
|
|
||||||
${pkgs.gnutar}/bin/tar -xf "/tmp/$filename" -C "$extract_dir" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -f "/tmp/$filename"
|
|
||||||
touch "$extract_dir/.$(basename $filename)-extracted"
|
|
||||||
echo "$filename setup complete!"
|
|
||||||
else
|
|
||||||
echo "Failed to download $filename"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Download dictionaries (using working URLs)
|
|
||||||
download_dict "https://web.archive.org/web/20200702203642/http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2" "gcide-dict.tar.bz2"
|
|
||||||
download_dict "https://cyphar.github.io/jpn-stardicts/JMdict-ja-en.tar.gz" "jmdict-ja-en.tar.gz"
|
|
||||||
|
|
||||||
echo "Dictionary setup process completed!"
|
|
||||||
'';
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
sdcv
|
|
||||||
curl # For downloading dictionaries
|
|
||||||
gnutar # For extracting dictionaries
|
|
||||||
];
|
|
||||||
|
|
||||||
# Environment variable for dictionary location
|
|
||||||
home.sessionVariables = {
|
|
||||||
STARDICT_DATA_DIR = "$HOME/.stardict/dic";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Note: Dictionary files will be downloaded automatically when you first run 'dict-setup'
|
|
||||||
# or you can run the setup manually at any time
|
|
||||||
|
|
||||||
# Shell aliases for different dictionary types
|
|
||||||
programs.zsh.shellAliases = {
|
|
||||||
# English-English dictionary
|
|
||||||
"e2e" = "sdcv";
|
|
||||||
|
|
||||||
# Japanese-English dictionary
|
|
||||||
"j2e" = "sdcv -u JMdict-ja-en";
|
|
||||||
|
|
||||||
# English-Japanese dictionary (same as Japanese-English - JMdict is bidirectional)
|
|
||||||
"e2j" = "sdcv -u JMdict-ja-en";
|
|
||||||
|
|
||||||
# Manual dictionary setup
|
|
||||||
"dict-setup" = toString setupDictionaries;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Install LibreOffice with Java support and dark mode wrapper
|
|
||||||
# Workaround for LibreOffice dark mode on NixOS (Issue #310578)
|
|
||||||
# LibreOffice ignores GTK dark theme due to GTK3 bug, so we wrap it with GTK_THEME=Adwaita:dark
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
(pkgs.symlinkJoin {
|
|
||||||
name = "libreoffice-dark";
|
|
||||||
paths = [ libreoffice-fresh ];
|
|
||||||
buildInputs = [ makeWrapper ];
|
|
||||||
postBuild = ''
|
|
||||||
for bin in $out/bin/*; do
|
|
||||||
wrapProgram $bin \
|
|
||||||
--set GTK_THEME Adwaita:dark
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
jre # Java Runtime Environment for LibreOffice features
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
environment.etc."logid.cfg".text = ''
|
|
||||||
devices: ({
|
|
||||||
name: "MX Master 3 for Mac";
|
|
||||||
|
|
||||||
thumbwheel: {
|
|
||||||
invert: true;
|
|
||||||
divert: false;
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.services.logiops = {
|
|
||||||
description = "Logitech Configuration Daemon";
|
|
||||||
wantedBy = [ "graphical.target" ];
|
|
||||||
after = [ "graphical.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "simple";
|
|
||||||
ExecStart = "${pkgs.logiops}/bin/logid";
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = 5;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.logiops-resume = {
|
|
||||||
description = "Restart logiops after resume";
|
|
||||||
after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ];
|
|
||||||
wantedBy = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = "${config.systemd.package}/bin/systemctl --no-block restart logiops.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
|
||||||
ACTION=="add", SUBSYSTEM=="input", ATTRS{id/vendor}=="046d", RUN{program}="${config.systemd.package}/bin/systemctl --no-block try-restart logiops.service"
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue