diff --git a/flake.lock b/flake.lock index 9131b34..6352bb5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,70 +1,5 @@ { "nodes": { - "ags": { - "inputs": { - "astal": "astal", - "nixpkgs": [ - "hyprpanel", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1744557573, - "narHash": "sha256-XAyj0iDuI51BytJ1PwN53uLpzTDdznPDQFG4RwihlTQ=", - "owner": "aylur", - "repo": "ags", - "rev": "3ed9737bdbc8fc7a7c7ceef2165c9109f336bff6", - "type": "github" - }, - "original": { - "owner": "aylur", - "repo": "ags", - "type": "github" - } - }, - "astal": { - "inputs": { - "nixpkgs": [ - "hyprpanel", - "ags", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1742571008, - "narHash": "sha256-5WgfJAeBpxiKbTR/gJvxrGYfqQRge5aUDcGKmU1YZ1Q=", - "owner": "aylur", - "repo": "astal", - "rev": "dc0e5d37abe9424c53dcbd2506a4886ffee6296e", - "type": "github" - }, - "original": { - "owner": "aylur", - "repo": "astal", - "type": "github" - } - }, - "astal_2": { - "inputs": { - "nixpkgs": [ - "hyprpanel", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1748416910, - "narHash": "sha256-FEQcs58HL8Fe4i7XlqVEUwthjxwvRvgX15gTTfW17sU=", - "owner": "aylur", - "repo": "astal", - "rev": "c1bd89a47c81c66ab5fc6872db5a916c0433fb89", - "type": "github" - }, - "original": { - "owner": "aylur", - "repo": "astal", - "type": "github" - } - }, "fenix": { "inputs": { "nixpkgs": [ @@ -95,11 +30,11 @@ ] }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", "type": "github" }, "original": { @@ -151,11 +86,11 @@ ] }, "locked": { - "lastModified": 1749526396, - "narHash": "sha256-UL9F76abAk87llXOrcQRjhd5OaOclUd6MIltsqcUZmo=", + "lastModified": 1751476662, + "narHash": "sha256-eX6wMGQjaTzedR6lz2IpEnAMgLcuQLQezBJNil7yG3s=", "owner": "nix-community", "repo": "home-manager", - "rev": "427c96044f11a5da50faf6adaf38c9fa47e6d044", + "rev": "9347c61bc0cbed0d2062b930144c2cbd557f9189", "type": "github" }, "original": { @@ -165,26 +100,6 @@ "type": "github" } }, - "hyprpanel": { - "inputs": { - "ags": "ags", - "astal": "astal_2", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1749022112, - "narHash": "sha256-NNGvih5zDjic+UVxm+1YYQMgRok6PcdNE0/6vzs+XrM=", - "owner": "jas-singhfsu", - "repo": "hyprpanel", - "rev": "20532ee760fdf492afcf987ae091497a37878197", - "type": "github" - }, - "original": { - "owner": "jas-singhfsu", - "repo": "hyprpanel", - "type": "github" - } - }, "ixx": { "inputs": { "flake-utils": [ @@ -215,27 +130,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1748370509, - "narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "4faa5f5321320e49a78ae7848582f684d64783e9", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1749523198, - "narHash": "sha256-How2kQw0psKmCdXgojc95Sf3K5maHB3qfINxTZFCAPM=", + "lastModified": 1751382304, + "narHash": "sha256-p+UruOjULI5lV16FkBqkzqgFasLqfx0bihLBeFHiZAs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cdc68935eba9f86d155585fdf6f17af6824f38ac", + "rev": "d31a91c9b3bee464d054633d5f8b84e17a637862", "type": "github" }, "original": { @@ -246,22 +145,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1749523198, - "narHash": "sha256-How2kQw0psKmCdXgojc95Sf3K5maHB3qfINxTZFCAPM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "cdc68935eba9f86d155585fdf6f17af6824f38ac", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1710272261, "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", @@ -287,11 +170,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1749496904, - "narHash": "sha256-eNDMzrcDBOprdJs7DpMOJfCEcxribxDJP2OjozSC3Wo=", + "lastModified": 1751463146, + "narHash": "sha256-mjrw7PTbdScg9tg/oghQYwsGfa2ZcSb14V6qcvl1rN8=", "owner": "nix-community", "repo": "nixvim", - "rev": "e0b3d8bc3a0ab5a7cc0792c7705e92f9c5c598f3", + "rev": "30d8be8628330bc5baa064e0dac904a574558b17", "type": "github" }, "original": { @@ -311,11 +194,11 @@ ] }, "locked": { - "lastModified": 1748298102, - "narHash": "sha256-PP11GVwUt7F4ZZi5A5+99isuq39C59CKc5u5yVisU/U=", + "lastModified": 1749730855, + "narHash": "sha256-L3x2nSlFkXkM6tQPLJP3oCBMIsRifhIDPMQQdHO5xWo=", "owner": "NuschtOS", "repo": "search", - "rev": "f8a1c221afb8b4c642ed11ac5ee6746b0fe1d32f", + "rev": "8dfe5879dd009ff4742b668d9c699bc4b9761742", "type": "github" }, "original": { @@ -328,7 +211,7 @@ "inputs": { "fenix": "fenix", "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "systems": "systems_4" }, "locked": { @@ -348,9 +231,7 @@ "root": { "inputs": { "home-manager": "home-manager", - "hyprpanel": "hyprpanel", - "nixpkgs": "nixpkgs_2", - "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs": "nixpkgs", "nixvim": "nixvim", "openapi-tui": "openapi-tui" } diff --git a/flake.nix b/flake.nix index 304c9b5..9df5526 100644 --- a/flake.nix +++ b/flake.nix @@ -3,19 +3,12 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; - hyprpanel = { - url = "github:jas-singhfsu/hyprpanel"; - # inputs.nixpkgs.follows = "nixpkgs"; - # inputs.home-manager.follows = "home-manager"; # Add this line - }; - nixvim = { url = "github:nix-community/nixvim/main"; # If using a stable channel you can use `url = "github:nix-community/nixvim/nixos-"` @@ -29,16 +22,13 @@ outputs = { self, nixpkgs, - nixpkgs-unstable, home-manager, nixvim, - hyprpanel, openapi-tui, ... }: let lib = nixpkgs.lib; pkgs = nixpkgs.legacyPackages."x86_64-linux"; - pkgsUnstable = nixpkgs-unstable.legacyPackages."x86_64-linux"; in { nixosConfigurations = { tatara = lib.nixosSystem { @@ -58,17 +48,12 @@ homeConfigurations.fabric = home-manager.lib.homeManagerConfiguration { inherit pkgs; extraSpecialArgs = { - inherit nixvim hyprpanel openapi-tui; + inherit nixvim openapi-tui; # deleted hyprpanel }; modules = [ - { - nixpkgs.overlays = [ - hyprpanel.overlay - ]; - } ./home/fabric/default.nix nixvim.homeManagerModules.nixvim - hyprpanel.homeManagerModules.hyprpanel + # hyprpanel.homeManagerModules.hyprpanel ]; }; }; diff --git a/home/fabric/default.nix b/home/fabric/default.nix index 83740de..15fce26 100644 --- a/home/fabric/default.nix +++ b/home/fabric/default.nix @@ -1,6 +1,6 @@ { nixvim, - hyprpanel, + # hyprpanel, pkgs, pkgsUnstable, config, @@ -21,6 +21,7 @@ ./desktop/hyprpanel.nix ./desktop/hyprpaper.nix ./desktop/hypridle.nix + ./desktop/desktop.nix ]; # Home Manager needs a bit of information about you and the paths it should manage @@ -45,6 +46,8 @@ kitty firefox mpv + grim + slurp nerd-fonts.dejavu-sans-mono nerd-fonts.daddy-time-mono @@ -123,8 +126,7 @@ zsh pavucontrol wofi - deno - hyprpanel + # hyprpanel alejandra rustup tmuxPlugins.sensible @@ -167,6 +169,10 @@ nodejs_24 openssl psmisc + air + pyfa + + google-chrome ]; # Enable home-manager diff --git a/home/fabric/desktop/desktop.nix b/home/fabric/desktop/desktop.nix new file mode 100644 index 0000000..4393d7f --- /dev/null +++ b/home/fabric/desktop/desktop.nix @@ -0,0 +1,89 @@ +{pkgs, ...}: let + # 1. Define the smart launcher script for QQ + qq-launcher = pkgs.writeShellScriptBin "launch-qq.sh" '' + #!/bin/sh + # Define the name for our persistent container + CONTAINER_NAME="qq-persistent" + + # Ensure the host directory for QQ's config exists + mkdir -p "$HOME/.config/qq-docker" + + # Check if the container is already running + if [ "$(${pkgs.docker}/bin/docker ps -q -f name=$CONTAINER_NAME)" ]; then + echo "Container is running. Sending activation signal via D-Bus..." + # This command asks the QQ application's D-Bus service to execute its 'show' method. + # The service name and path are educated guesses based on common Qt app behavior. + ${pkgs.docker}/bin/docker exec --user user "$CONTAINER_NAME" \ + qdbus com.tencent.QQ /MainApplication show + exit 0 + fi + + # Check if the container exists but is stopped + if [ "$(${pkgs.docker}/bin/docker ps -a -q -f name=$CONTAINER_NAME)" ]; then + # If stopped, just start it + echo "Starting existing, stopped QQ container..." + ${pkgs.docker}/bin/docker start "$CONTAINER_NAME" + exit 0 + fi + + # If the container does not exist at all, create it for the first time + echo "Container not found. Creating and starting new QQ container..." + ${pkgs.docker}/bin/docker run \ + -d \ + --name "$CONTAINER_NAME" \ + --user $(id -u):$(id -g) \ + --network=default \ + -e DISPLAY \ + -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ + -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \ + -e QT_QPA_PLATFORM=wayland \ + -e DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \ + -e GTK_IM_MODULE=fcitx \ + -e QT_IM_MODULE=fcitx \ + -e XMODIFIERS=@im=fcitx \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY=$DISPLAY \ + -e XDG_SESSION_TYPE=wayland \ + --ipc=host \ + -v "$HOME/.config/qq-docker:/home/user/.config" \ + -v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR:rw" \ + -v "/dev/dri:/dev/dri:rw" \ + -v "$HOME/xdg-open-proxy:/usr/bin/xdg-open:ro" \ + -v "/etc/machine-id:/etc/machine-id:ro" \ + --security-opt="no-new-privileges" \ + --cap-drop="ALL" \ + qq-isolated + ''; +in { + home.packages = [qq-launcher]; + xdg.desktopEntries = { + # 2. Declaratively create the .desktop file + "qq-docker" = { + name = "QQ (Docker)"; + comment = "Run QQ inside a secure Docker container"; + exec = "launch-qq.sh"; + type = "Application"; + }; + + discord = { + # The name that will appear in Wofi + name = "Discord"; + + # A more generic name, also used by menus + genericName = "Discord"; + + # This is the most important part! + # The command to execute. %U is a placeholder for URLs if you open a link with it. + exec = "discord --enable-wayland-ime"; + + # Tell the system this is not a terminal application + terminal = false; + + # Use the standard Firefox icon for a consistent look + icon = "discord"; + + # The type of the entry + type = "Application"; + }; + }; +} diff --git a/home/fabric/desktop/hyprland.nix b/home/fabric/desktop/hyprland.nix index 62d22c4..15757bd 100644 --- a/home/fabric/desktop/hyprland.nix +++ b/home/fabric/desktop/hyprland.nix @@ -17,6 +17,7 @@ gaps_in = 0; gaps_out = "0, 440, 0, 440"; }; + animations.enabled = false; input = { "repeat_delay" = 300; @@ -24,19 +25,27 @@ }; exec-once = [ - # "hypridle" + "fcitx5" ]; windowrule = [ + "workspace 1 silent,initialTitle:^EVE$" + "tile, initialTitle:^EVE$" + "workspace 6 silent,class:^QQ$" + "float, title:^图片查看器$" "workspace 6 silent,class:^(discord)$" "workspace 4 silent,class:^(kitty)$" "workspace 5 silent,class:^(firefox)$" ]; - # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + workspace = [ + "r[1-3], gapsout:0" + ]; + bind = [ "$mainMod, T, exec, $terminal" "$mainMod, B, exec, $browser" + "$mainMod, S, exec, sh -c \"grim -g '$(slurp -d)' - | wl-copy\"" "$mainMod, Q, killactive" "$mainMod, M, exit" "$mainMod, E, exec, $fileManager" @@ -69,7 +78,7 @@ "$mainMod SHIFT, 3, movetoworkspace, 3" "$mainMod SHIFT, 4, movetoworkspace, 4" "$mainMod SHIFT, 5, movetoworkspace, 5" - "$mainMod SHIFT, 6, movetoworkspace, 6" + "$mainMoe SHIFT, 6, movetoworkspace, 6" # Typo was here, corrected to $mainMod "$mainMod SHIFT, 7, movetoworkspace, 7" "$mainMod SHIFT, 8, movetoworkspace, 8" "$mainMod SHIFT, 9, movetoworkspace, 9" @@ -82,6 +91,7 @@ "$mainMod, mouse:273, resizewindow" # Super + Right Mouse Button to resize windows ]; monitor = [ + "DP-3, 3440x1440@144.00HZ, 0x0, 1" "DP-5, 3440x1440@144.00HZ, 0x0, 1" ]; }; diff --git a/home/fabric/desktop/hyprpanel.nix b/home/fabric/desktop/hyprpanel.nix index f673cb4..86edf5b 100644 --- a/home/fabric/desktop/hyprpanel.nix +++ b/home/fabric/desktop/hyprpanel.nix @@ -1,16 +1,11 @@ # home/fabric/desktop/hyprpanel.nix -{ - config, - pkgs, - hyprpanel, - ... -}: { +{pkgs, ...}: { # Wayland settings for hyprpanel - wayland.windowManager.hyprland.settings = { - exec-once = [ - "${pkgs.hyprpanel}/bin/hyprpanel" - ]; - }; + # wayland.windowManager.hyprland.settings = { + # exec-once = [ + # "${pkgs.hyprpanel}/bin/hyprpanel" + # ]; + # }; programs.hyprpanel = { # Enable the module. @@ -19,9 +14,6 @@ # Add to Hyprland config # hyprland.enable = true; - # Fix the overwrite issue - overwrite.enable = false; - # Configure and theme options settings = { # Configure bar layouts for monitors diff --git a/home/fabric/programs/nixvim.nix b/home/fabric/programs/nixvim.nix index 5fd339d..cf76ffe 100644 --- a/home/fabric/programs/nixvim.nix +++ b/home/fabric/programs/nixvim.nix @@ -73,12 +73,11 @@ prev = "[["; }; }; - provider = "ollama"; - auto_suggestions_provider = "ollama"; - ollama = { + providers.ollama = { endpoint = "http://127.0.0.1:11434"; model = "kirito1/qwen3-coder"; }; + auto_suggestions_provider = "ollama"; windows = { sidebar_header = { align = "center"; diff --git a/hosts/common/optional/bluetooth.nix b/hosts/common/optional/bluetooth.nix new file mode 100644 index 0000000..8cc5a1b --- /dev/null +++ b/hosts/common/optional/bluetooth.nix @@ -0,0 +1,12 @@ +{ + config, + pkgs, + ... +}: { + # Enable Bluetooth + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.blueman.enable = true; +} diff --git a/hosts/common/optional/fcitx5.nix b/hosts/common/optional/fcitx5.nix new file mode 100644 index 0000000..3ef8337 --- /dev/null +++ b/hosts/common/optional/fcitx5.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + i18n.inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.addons = with pkgs; [ + fcitx5-chinese-addons + fcitx5-pinyin-zhwiki + fcitx5-pinyin-moegirl + fcitx5-pinyin-minecraft + ]; + }; +} diff --git a/hosts/common/optional/flatpak.nix b/hosts/common/optional/flatpak.nix new file mode 100644 index 0000000..77c510f --- /dev/null +++ b/hosts/common/optional/flatpak.nix @@ -0,0 +1,4 @@ +# hosts/common/optional/flatpak.nix +{...}: { + services.flatpak.enable = true; +} diff --git a/hosts/common/optional/sunshine.nix b/hosts/common/optional/sunshine.nix new file mode 100644 index 0000000..b64aa65 --- /dev/null +++ b/hosts/common/optional/sunshine.nix @@ -0,0 +1,8 @@ +{...}: { + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; +} diff --git a/hosts/zion/default.nix b/hosts/zion/default.nix index 90b5315..427bce0 100644 --- a/hosts/zion/default.nix +++ b/hosts/zion/default.nix @@ -14,6 +14,10 @@ ../common/optional/nvidia.nix ../common/optional/docker.nix ../common/optional/steam.nix + ../common/optional/flatpak.nix + ../common/optional/fcitx5.nix + ../common/optional/bluetooth.nix + ../common/optional/sunshine.nix ]; # Bootloader diff --git a/hosts/zion/hardware-configuration.nix b/hosts/zion/hardware-configuration.nix index 1caa980..add8519 100644 --- a/hosts/zion/hardware-configuration.nix +++ b/hosts/zion/hardware-configuration.nix @@ -16,6 +16,8 @@ boot.initrd.kernelModules = []; boot.kernelModules = ["kvm-amd"]; + hardware.enableRedistributableFirmware = true; + # Firmware packages hardware.firmware = with pkgs; [ linux-firmware