From e754a9c329db1db7e75b54eb3ad4cf4d44a58061 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Mon, 5 Jan 2026 21:06:11 +0100 Subject: [PATCH] clean up --- modules/dictionary.nix | 69 ----------------------------------------- modules/libreoffice.nix | 21 ------------- modules/logiops.nix | 41 ------------------------ 3 files changed, 131 deletions(-) delete mode 100644 modules/dictionary.nix delete mode 100644 modules/libreoffice.nix delete mode 100644 modules/logiops.nix diff --git a/modules/dictionary.nix b/modules/dictionary.nix deleted file mode 100644 index 63e7496..0000000 --- a/modules/dictionary.nix +++ /dev/null @@ -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; - }; -} diff --git a/modules/libreoffice.nix b/modules/libreoffice.nix deleted file mode 100644 index d2b9aec..0000000 --- a/modules/libreoffice.nix +++ /dev/null @@ -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 - ]; -} diff --git a/modules/logiops.nix b/modules/logiops.nix deleted file mode 100644 index 29bbac2..0000000 --- a/modules/logiops.nix +++ /dev/null @@ -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" - ''; -}