From 71e22f65bbad796d2671be7b0b0f03ad523c0618 Mon Sep 17 00:00:00 2001 From: tulg Date: Sat, 10 Jan 2026 18:00:49 +0300 Subject: [PATCH] modularization --- config/hypr/hyprland.conf | 35 +----- modules/home-manager/cli/default.nix | 6 + modules/home-manager/cli/shell.nix | 26 ++++ modules/home-manager/cli/yazi.nix | 35 ++++++ modules/home-manager/desktop/browsers/zen.nix | 17 +++ modules/home-manager/desktop/default.nix | 9 ++ modules/home-manager/desktop/hyprland.nix | 29 +++++ .../home-manager/{ => desktop}/noctalia.nix | 2 +- modules/home-manager/desktop/spicetify.nix | 16 +++ modules/home-manager/desktop/symlink.nix | 25 ++++ modules/home-manager/home.nix | 114 +----------------- modules/home-manager/stylix.nix | 4 +- 12 files changed, 173 insertions(+), 145 deletions(-) create mode 100644 modules/home-manager/cli/default.nix create mode 100644 modules/home-manager/cli/shell.nix create mode 100644 modules/home-manager/cli/yazi.nix create mode 100644 modules/home-manager/desktop/browsers/zen.nix create mode 100644 modules/home-manager/desktop/default.nix create mode 100644 modules/home-manager/desktop/hyprland.nix rename modules/home-manager/{ => desktop}/noctalia.nix (97%) create mode 100644 modules/home-manager/desktop/spicetify.nix create mode 100644 modules/home-manager/desktop/symlink.nix diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 7ee6519..3b71fb0 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -124,19 +124,6 @@ misc { # sensitivity = -0.5 #} -# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -# Example windowrule v1 -#windowrule = float, ^(kitty)$ -#windowrule = float, ^(garuda-assistant)$ -#windowrule = float, ^(garuda-boot-options)$ -#windowrule = float, ^(garuda-boot-repair)$ -#windowrule = float, ^(garuda-gamer)$ -#windowrule = float, ^(garuda-network-assistant)$ -#windowrule = float, ^(garuda-settings-manager)$ -#windowrule = float, ^(garuda-welcome)$ - -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = ALT @@ -238,12 +225,6 @@ bind = $mainMod, F, fullscreen bind = $mainMod, Q, exec, kitty yazi bind = ,232,exec,brightnessctl -c backlight set 5%- bind = ,233,exec,brightnessctl -c backlight set +5% -#bind = $mainMod SHIFT,C, exec, killall -9 wpaperd && wpaperd - -# Screenshots: -# -# Change to swappy https://github.com/jtheoof/swappy -# Old functions only commented out to make it easier for the user to change if necessary. # Snip a selection and pipe to swappy bind =$mainMod,S, exec, grim -g "$(slurp)" - | swappy -f - @@ -252,17 +233,6 @@ bind = CTRL, Print, exec, .config/hypr/scripts/screenshot_window.sh # Screenshot the current display and pipe to swappy bind = SHIFT, Print, exec, .config/hypr/scripts/screenshot_display.sh -# https://github.com/hyprwm/contrib/blob/main/grimblast/grimblast.1.scd -# Print: All outputs -# SHIFT+Print: Select area -# $mainMod+Print: Current window -# $mainMod+Shfit+Print: Current output -# -# bind = ,Print, exec, grimblast save screen && notify-send Screenshot captured -# bind = SHIFT, Print, exec, grimblast save area && notify-send Selected\ area captured -# bind = $mainMod, Print, exec, grimblast save active && notify-send Active\ window captured -# bind = $mainMod SHIFT, Print, exec, grimblast output active && notify-send Output captured - # for resizing window # will switch to a submap called resize bind=$mainMod,R,submap,resize @@ -299,9 +269,8 @@ bind = $mainMod SHIFT,L, movewindow, r # other blurings blurls = wofi blurls = thunar -blurls = gedit -blurls = gtk-layer-shell # for nwg-drawer -blurls = catfish +blurls = gtk-layer-shell + # window rules #windowrule = opacity 0.85 override 0.85 override,^(thunar)$ #windowrule = opacity 0.85 override 0.85 override,^(gedit)$ diff --git a/modules/home-manager/cli/default.nix b/modules/home-manager/cli/default.nix new file mode 100644 index 0000000..109623f --- /dev/null +++ b/modules/home-manager/cli/default.nix @@ -0,0 +1,6 @@ +{lib, ...}: { + imports = [ + ./yazi.nix + ./shell.nix + ]; +} diff --git a/modules/home-manager/cli/shell.nix b/modules/home-manager/cli/shell.nix new file mode 100644 index 0000000..df27e22 --- /dev/null +++ b/modules/home-manager/cli/shell.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: { + programs.bash = { + enable = true; + + shellAliases = { + a = "echo idssss"; + rb = "sudo nixos-rebuild switch --flake ~/nixdots#"; + nixtest = "sudo nixos-rebuild test --flake ~/nixdots#"; + infect = "nix run github:nix-community/nixos-anywhere -- -- flake"; + }; + + bashrcExtra = '' + PS1="\[\e[38;5;177m\]\u\[\e[38;5;220m\]@\[\e[38;5;1m\]\h \[\e[38;5;33m\]\w \[\033[0m\]\$ " + ''; + }; + + programs.git = { + enable = true; + settings = { + user.name = "tulg"; + user.email = "tulg@protonmail.ch"; + }; + }; + + programs.zsh.enable = true; +} diff --git a/modules/home-manager/cli/yazi.nix b/modules/home-manager/cli/yazi.nix new file mode 100644 index 0000000..21c9c0b --- /dev/null +++ b/modules/home-manager/cli/yazi.nix @@ -0,0 +1,35 @@ +{ + config, + pkgs, + ... +}: { + programs.yazi = { + enable = true; + + settings = { + mgr = { + ratio = [1 1 6]; + }; + + preview = { + max_width = 1000; + max_height = 900; + }; + + tasks = { + image_bound = [0 0]; + }; + + keymap = { + mgr.prepend_keymap = [ + { + on = "x"; + for = "linux"; + run = "shell -- hyprctl hyprpaper wallpaper ,%h"; + desc = "Set hovered file as wallpaper"; + } + ]; + }; + }; + }; +} diff --git a/modules/home-manager/desktop/browsers/zen.nix b/modules/home-manager/desktop/browsers/zen.nix new file mode 100644 index 0000000..979c0dc --- /dev/null +++ b/modules/home-manager/desktop/browsers/zen.nix @@ -0,0 +1,17 @@ +{ + lib, + inputs, + ... +}: { + imports = [ + inputs.zen-browser.homeModules.twilight + ]; + programs.zen-browser.enable = true; + + programs.firefox.enable = true; + + programs.zen-browser.policies = { + DisableAppUpdate = true; + DisableTelemetry = true; + }; +} diff --git a/modules/home-manager/desktop/default.nix b/modules/home-manager/desktop/default.nix new file mode 100644 index 0000000..82dbb27 --- /dev/null +++ b/modules/home-manager/desktop/default.nix @@ -0,0 +1,9 @@ +{lib, ...}: { + imports = [ + ./noctalia.nix + ./symlink.nix + ./hyprland.nix + ./spicetify.nix + ./browsers/zen.nix + ]; +} diff --git a/modules/home-manager/desktop/hyprland.nix b/modules/home-manager/desktop/hyprland.nix new file mode 100644 index 0000000..4ea67bb --- /dev/null +++ b/modules/home-manager/desktop/hyprland.nix @@ -0,0 +1,29 @@ +{ + lib, + pkgs, + ... +}: { + home.pointerCursor = { + gtk.enable = true; + x11.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 16; + }; + + home.sessionVariables = { + NIXOS_OZONE_WL = "1"; # hint Electron apps to use Wayland + QT_QPA_PLATFORM = "wayland"; + KITTY_DISABLE_WAYLAND_PORTAL = 1; + }; + + xdg.portal = { + enable = true; + # wlr.enable = true; + config.common.default = "hyprland"; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-hyprland + ]; + }; +} diff --git a/modules/home-manager/noctalia.nix b/modules/home-manager/desktop/noctalia.nix similarity index 97% rename from modules/home-manager/noctalia.nix rename to modules/home-manager/desktop/noctalia.nix index bf36359..5e2f80b 100644 --- a/modules/home-manager/noctalia.nix +++ b/modules/home-manager/desktop/noctalia.nix @@ -4,7 +4,7 @@ ... }: { imports = [ - #inputs.noctalia.homeModules.default + inputs.noctalia.homeModules.default ]; programs.noctalia-shell = { diff --git a/modules/home-manager/desktop/spicetify.nix b/modules/home-manager/desktop/spicetify.nix new file mode 100644 index 0000000..52a3c7d --- /dev/null +++ b/modules/home-manager/desktop/spicetify.nix @@ -0,0 +1,16 @@ +{ + inputs, + pkgs, + ... +}: let + spicePkgs = + inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system}; +in { + imports = [ + inputs.spicetify-nix.homeManagerModules.default + ]; + + programs.spicetify = { + enable = true; + }; +} diff --git a/modules/home-manager/desktop/symlink.nix b/modules/home-manager/desktop/symlink.nix new file mode 100644 index 0000000..21afd1c --- /dev/null +++ b/modules/home-manager/desktop/symlink.nix @@ -0,0 +1,25 @@ +{config, ...}: let + dots = "${config.home.homeDirectory}/nixdots/config"; + link = path: config.lib.file.mkOutOfStoreSymlink path; +in { + xdg.configFile."hypr" = { + source = link "${dots}/hypr"; + recursive = true; + }; + xdg.configFile."waybar" = { + source = link "${dots}/waybar"; + recursive = true; + }; + xdg.configFile."kitty" = { + source = link "${dots}/kitty"; + recursive = true; + }; + xdg.configFile."wofi" = { + source = link "${dots}/wofi"; + recursive = true; + }; + xdg.configFile."mako" = { + source = link "${dots}/mako"; + recursive = true; + }; +} diff --git a/modules/home-manager/home.nix b/modules/home-manager/home.nix index 0e36f35..950cb05 100644 --- a/modules/home-manager/home.nix +++ b/modules/home-manager/home.nix @@ -3,20 +3,12 @@ pkgs, inputs, ... -}: let - dots = "${config.home.homeDirectory}/nixdots/config"; - symlink = path: config.lib.file.mkOutOfStoreSymlink path; - spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system}; -in { +}: { imports = [ - inputs.zen-browser.homeModules.twilight - inputs.spicetify-nix.homeManagerModules.default - inputs.noctalia.homeModules.default - - ./noctalia.nix + ./cli/default.nix + ./desktop/default.nix ]; # Home Manager settings - programs.noctalia-shell.enable = true; nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"]; home.username = "tulg"; home.homeDirectory = "/home/tulg"; @@ -44,6 +36,7 @@ in { hyprcursor parsec-bin file-roller + hyprpaper hyprpolkitagent pkgs.nixd swww @@ -65,103 +58,6 @@ in { profiles.tulg.userSettings = { }; }; - programs.zen-browser.enable = true; - programs.zsh.enable = true; - programs.zen-browser.policies = { - DisableAppUpdate = true; - DisableTelemetry = true; - }; + programs.vesktop.enable = true; - - programs.spicetify = { - enable = true; - }; - programs.yazi = { - enable = true; - settings = { - mgr = { - ratio = [1 1 6]; - }; - preview = { - max_width = 1000; - max_height = 900; - }; - tasks = { - image_bound = [0 0]; - }; - }; - }; - - xdg.configFile."hypr" = { - source = symlink "${dots}/hypr"; - recursive = true; - }; - - xdg.configFile."waybar" = { - source = symlink "${dots}/waybar"; - recursive = true; - }; - - xdg.configFile."kitty" = { - source = symlink "${dots}/kitty"; - recursive = true; - }; - - xdg.configFile."wofi" = { - source = symlink "${dots}/wofi"; - recursive = true; - }; - - xdg.configFile."mako" = { - source = symlink "${dots}/mako"; - recursive = true; - }; - - programs.firefox.enable = true; - programs.bash = { - enable = true; - - shellAliases = { - a = "echo idssss"; - rb = "sudo nixos-rebuild switch --flake ~/nixdots#"; - nixtest = "sudo nixos-rebuild test --flake ~/nixdots#"; - infect = "nix run github:nix-community/nixos-anywhere -- -- flake"; - }; - - bashrcExtra = '' - PS1="\[\e[38;5;177m\]\u\[\e[38;5;220m\]@\[\e[38;5;1m\]\h \[\e[38;5;33m\]\w \[\033[0m\]\$ " - ''; - }; - - programs.git = { - enable = true; - settings = { - user.name = "tulg"; - user.email = "tulg@protonmail.ch"; - }; - }; - - home.pointerCursor = { - gtk.enable = true; - x11.enable = true; - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; - size = 16; - }; - - home.sessionVariables = { - NIXOS_OZONE_WL = "1"; # hint Electron apps to use Wayland - QT_QPA_PLATFORM = "wayland"; - KITTY_DISABLE_WAYLAND_PORTAL=1; - }; - - xdg.portal = { - enable = true; -# wlr.enable = true; - config.common.default = "hyprland"; - xdgOpenUsePortal = true; - extraPortals = [ - pkgs.xdg-desktop-portal-hyprland - ]; - }; } diff --git a/modules/home-manager/stylix.nix b/modules/home-manager/stylix.nix index bf49993..c812dc7 100644 --- a/modules/home-manager/stylix.nix +++ b/modules/home-manager/stylix.nix @@ -1,11 +1,12 @@ { config, pkgs, + inputs, ... }: { fonts.fontconfig.enable = true; fonts.packages = with pkgs; [ -# noto-fonts-color-emoji + # noto-fonts-color-emoji fira fira-sans fira-code @@ -51,7 +52,6 @@ targets.nixvim.enable = false; targets.qt.enable = true; # targets.rofi.enable = false; - targets.spicetify.enable = true; # image = ../../assets/Shogoki.png; # opacity = {