diff --git a/nixcfgs/flake.nix b/nixcfgs/flake.nix index a4bffdf..8be3e55 100644 --- a/nixcfgs/flake.nix +++ b/nixcfgs/flake.nix @@ -27,79 +27,84 @@ }; }; - outputs = { - self, - nixpkgs, - nix-flatpak, - nix-darwin, - home-manager, - plasma-manager, - nur, - winboat, - caelestia-shell, - ... - } @ inputs: let - overlays = [ - nur.overlays.default - (final: prev: { - winboat = winboat.packages.x86_64-linux.winboat; - }) - ]; - forSystem = system: - import nixpkgs { - inherit system overlays; - config.allowUnfree = true; - }; - specialArgs = {inherit inputs;}; - nixosHosts = [ - "zp" - "zephyrus" - "nixvirt" - ]; - - mkNixosSystem = hostname: - 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 + outputs = + { + self, + nixpkgs, + nix-flatpak, + nix-darwin, + home-manager, + plasma-manager, + nur, + winboat, + caelestia-shell, + ... + }@inputs: + let + overlays = [ + nur.overlays.default + (final: prev: { + winboat = winboat.packages.x86_64-linux.winboat; + }) + ]; + forSystem = + system: + import nixpkgs { + inherit system overlays; + config.allowUnfree = true; + }; + specialArgs = { inherit inputs; }; + nixosHosts = [ + "zp" + "zephyrus" + "nixvirt" ]; - }; - homeConfigurations = { - js0ny = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "x86_64-linux"; - extraSpecialArgs = specialArgs; + mkNixosSystem = + hostname: + 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 = [ - ./users/js0ny + ./hosts/zen ]; }; - "js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "x86_64-linux"; - extraSpecialArgs = specialArgs; - modules = [ - ./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 - ]; + + homeConfigurations = { + js0ny = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny + ]; + }; + "js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./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 + ]; + }; }; }; - }; } diff --git a/nixcfgs/modules/nixos/configuration.nix b/nixcfgs/modules/nixos/configuration.nix index 6b9112d..044460a 100644 --- a/nixcfgs/modules/nixos/configuration.nix +++ b/nixcfgs/modules/nixos/configuration.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ security.pam.services.login.enableGnomeKeyring = true; # Use latest kernel. @@ -83,7 +84,10 @@ # (/run/current-system/configuration.nix). This is useful in case you # accidentally delete configuration.nix. # 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). services.libinput.enable = true; @@ -91,7 +95,12 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.js0ny = { 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; [ tree ]; diff --git a/nixcfgs/users/js0ny/packages/cli.nix b/nixcfgs/users/js0ny/packages/cli.nix index f7e149e..4520e1d 100644 --- a/nixcfgs/users/js0ny/packages/cli.nix +++ b/nixcfgs/users/js0ny/packages/cli.nix @@ -40,6 +40,7 @@ fish zoxide wakatime-cli + sdcv # Langs # lua luajit lua51Packages.luarocks @@ -51,5 +52,6 @@ nushell powershell powershell-editor-services + package-version-server ]; } diff --git a/nixcfgs/users/js0ny/packages/gui.nix b/nixcfgs/users/js0ny/packages/gui.nix index cd419f7..286d50b 100644 --- a/nixcfgs/users/js0ny/packages/gui.nix +++ b/nixcfgs/users/js0ny/packages/gui.nix @@ -1,6 +1,6 @@ -{pkgs, ...}: { - home.packages = with pkgs; - [ +{ pkgs, lib, ... }: +{ + home.packages = with pkgs; [ kitty ghostty alacritty @@ -12,10 +12,13 @@ pcloud telegram-desktop steam + # Use Wayland for Jetbrains (jetbrains.idea-ultimate.override { - vmopts = ''-Dawt.toolkit.name=WLToolkit'';}) + vmopts = ''-Dawt.toolkit.name=WLToolkit''; + }) (jetbrains.rider.override { - vmopts = ''-Dawt.toolkit.name=WLToolkit'';}) + vmopts = ''-Dawt.toolkit.name=WLToolkit''; + }) warp-terminal # clash-verge-rev haruna @@ -36,5 +39,36 @@ protonmail-bridge-gui mpv 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"; + }; + }; + }; } diff --git a/nixcfgs/users/js0ny/programs/sdcv.nix b/nixcfgs/users/js0ny/programs/sdcv.nix deleted file mode 100644 index 90cf73b..0000000 --- a/nixcfgs/users/js0ny/programs/sdcv.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs }: -{ - home.packages = with pkgs; [ - sdcv - ]; - home.sessionVariables = { - STARDICT_DATA_DIR = "$HOME/.local/share/stardict/dic"; - }; -} diff --git a/nixcfgs/users/js0ny/zephyrus.nix b/nixcfgs/users/js0ny/zephyrus.nix index fa92e45..832855f 100644 --- a/nixcfgs/users/js0ny/zephyrus.nix +++ b/nixcfgs/users/js0ny/zephyrus.nix @@ -35,7 +35,6 @@ in ./programs/firefox.nix ./programs/distrobox.nix ./programs/mime.nix - ./programs/sdcv.nix ./programs/zed-editor.nix # ./programs/floorp.nix ../../modules/home/gnome-keyrings.nix