nix: Add goldendict-ng

This commit is contained in:
js0ny 2025-10-20 01:22:08 +01:00
parent a9d8bcb500
commit 5f1729caf4
6 changed files with 126 additions and 86 deletions

View file

@ -27,79 +27,84 @@
}; };
}; };
outputs = { outputs =
self, {
nixpkgs, self,
nix-flatpak, nixpkgs,
nix-darwin, nix-flatpak,
home-manager, nix-darwin,
plasma-manager, home-manager,
nur, plasma-manager,
winboat, nur,
caelestia-shell, winboat,
... caelestia-shell,
} @ inputs: let ...
overlays = [ }@inputs:
nur.overlays.default let
(final: prev: { overlays = [
winboat = winboat.packages.x86_64-linux.winboat; nur.overlays.default
}) (final: prev: {
]; winboat = winboat.packages.x86_64-linux.winboat;
forSystem = system: })
import nixpkgs { ];
inherit system overlays; forSystem =
config.allowUnfree = true; system:
}; import nixpkgs {
specialArgs = {inherit inputs;}; inherit system overlays;
nixosHosts = [ config.allowUnfree = true;
"zp" };
"zephyrus" specialArgs = { inherit inputs; };
"nixvirt" nixosHosts = [
]; "zp"
"zephyrus"
mkNixosSystem = hostname: "nixvirt"
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [./hosts/${hostname}];
};
in {
# This will automatically generate nixOS config for `nixosHosts'
# Include the module ./hosts/${hostname} by default.
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit specialArgs;
modules = [
./hosts/zen
]; ];
};
homeConfigurations = { mkNixosSystem =
js0ny = home-manager.lib.homeManagerConfiguration { hostname:
pkgs = forSystem "x86_64-linux"; nixpkgs.lib.nixosSystem {
extraSpecialArgs = specialArgs; system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/${hostname} ];
};
in
{
# This will automatically generate nixOS config for `nixosHosts'
# Include the module ./hosts/${hostname} by default.
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit specialArgs;
modules = [ modules = [
./users/js0ny ./hosts/zen
]; ];
}; };
"js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux"; homeConfigurations = {
extraSpecialArgs = specialArgs; js0ny = home-manager.lib.homeManagerConfiguration {
modules = [ pkgs = forSystem "x86_64-linux";
./users/js0ny/zephyrus.nix extraSpecialArgs = specialArgs;
plasma-manager.homeModules.plasma-manager modules = [
nix-flatpak.homeManagerModules.nix-flatpak ./users/js0ny
]; ];
}; };
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration { "js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux"; pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs; extraSpecialArgs = specialArgs;
modules = [ modules = [
./users/js0ny/nixvirt.nix ./users/js0ny/zephyrus.nix
]; plasma-manager.homeModules.plasma-manager
nix-flatpak.homeManagerModules.nix-flatpak
];
};
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/nixvirt.nix
];
};
}; };
}; };
};
} }

View file

@ -2,7 +2,8 @@
config, config,
pkgs, pkgs,
... ...
}: { }:
{
security.pam.services.login.enableGnomeKeyring = true; security.pam.services.login.enableGnomeKeyring = true;
# Use latest kernel. # Use latest kernel.
@ -83,7 +84,10 @@
# (/run/current-system/configuration.nix). This is useful in case you # (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix. # accidentally delete configuration.nix.
# system.copySystemConfiguration = true; # system.copySystemConfiguration = true;
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true; services.libinput.enable = true;
@ -91,7 +95,12 @@
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.js0ny = { users.users.js0ny = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "docker" "libvirtd" "dialout"]; # Enable sudo for the user. extraGroups = [
"wheel"
"docker"
"libvirtd"
"dialout"
]; # Enable sudo for the user.
packages = with pkgs; [ packages = with pkgs; [
tree tree
]; ];

View file

@ -40,6 +40,7 @@
fish fish
zoxide zoxide
wakatime-cli wakatime-cli
sdcv
# Langs # Langs
# lua luajit # lua luajit
lua51Packages.luarocks lua51Packages.luarocks
@ -51,5 +52,6 @@
nushell nushell
powershell powershell
powershell-editor-services powershell-editor-services
package-version-server
]; ];
} }

View file

@ -1,6 +1,6 @@
{pkgs, ...}: { { pkgs, lib, ... }:
home.packages = with pkgs; {
[ home.packages = with pkgs; [
kitty kitty
ghostty ghostty
alacritty alacritty
@ -12,10 +12,13 @@
pcloud pcloud
telegram-desktop telegram-desktop
steam steam
# Use Wayland for Jetbrains
(jetbrains.idea-ultimate.override { (jetbrains.idea-ultimate.override {
vmopts = ''-Dawt.toolkit.name=WLToolkit'';}) vmopts = ''-Dawt.toolkit.name=WLToolkit'';
})
(jetbrains.rider.override { (jetbrains.rider.override {
vmopts = ''-Dawt.toolkit.name=WLToolkit'';}) vmopts = ''-Dawt.toolkit.name=WLToolkit'';
})
warp-terminal warp-terminal
# clash-verge-rev # clash-verge-rev
haruna haruna
@ -36,5 +39,36 @@
protonmail-bridge-gui protonmail-bridge-gui
mpv mpv
neovim-qt neovim-qt
goldendict-ng
]; ];
xdg.desktopEntries = {
# Force wayland when running goldendict-ng
"io.github.xiaoyifang.goldendict_ng" = {
name = "GoldenDict-ng";
genericName = "Multiformat Dictionary";
comment = "A feature-rich dictionary lookup program";
icon = "goldendict";
type = "Application";
terminal = false;
categories = [
"Office"
"Dictionary"
"Education"
"Qt"
];
mimeType = [
"x-scheme-handler/goldendict"
"x-scheme-handler/dict"
];
exec = "env GOLDENDICT_FORCE_WAYLAND=1 ${pkgs.goldendict-ng}/bin/goldendict %u";
settings = {
"GenericName[zh_CN]" = "";
"Comment[zh_CN]" = "";
"Keywords" = "dict;dictionary";
"Keywords[zh_CN]" = "dict;dictionary;;";
"StartupWMClass" = "GoldenDict-ng";
};
};
};
} }

View file

@ -1,9 +0,0 @@
{ pkgs }:
{
home.packages = with pkgs; [
sdcv
];
home.sessionVariables = {
STARDICT_DATA_DIR = "$HOME/.local/share/stardict/dic";
};
}

View file

@ -35,7 +35,6 @@ in
./programs/firefox.nix ./programs/firefox.nix
./programs/distrobox.nix ./programs/distrobox.nix
./programs/mime.nix ./programs/mime.nix
./programs/sdcv.nix
./programs/zed-editor.nix ./programs/zed-editor.nix
# ./programs/floorp.nix # ./programs/floorp.nix
../../modules/home/gnome-keyrings.nix ../../modules/home/gnome-keyrings.nix