From bf2cdca9dcd05f46733f24cc26e9ffca8af57a10 Mon Sep 17 00:00:00 2001 From: joy Date: Sun, 8 Sep 2024 17:04:51 +0200 Subject: [PATCH] cleanig --- flake.lock | 265 +-------------------- flake.nix | 9 +- modules/apps/helix/default.nix | 6 +- modules/hypr/hyprland/default.nix | 322 ++++++++++++-------------- modules/system/homemanger/default.nix | 8 +- 5 files changed, 165 insertions(+), 445 deletions(-) diff --git a/flake.lock b/flake.lock index a57fbe4..e9639d6 100644 --- a/flake.lock +++ b/flake.lock @@ -19,39 +19,6 @@ "type": "github" } }, - "aquamarine": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1725199881, - "narHash": "sha256-jsmipf/u1GFZE5tBUkr56CHMN6VpUWCAjfLIhvQijU0=", - "owner": "hyprwm", - "repo": "aquamarine", - "rev": "f8a687dd29ff019657498f1bd14da2fbbf0e604b", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "aquamarine", - "type": "github" - } - }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -315,168 +282,6 @@ "type": "github" } }, - "hyprcursor": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1722623071, - "narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=", - "owner": "hyprwm", - "repo": "hyprcursor", - "rev": "912d56025f03d41b1ad29510c423757b4379eb1c", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprcursor", - "type": "github" - } - }, - "hyprland": { - "inputs": { - "aquamarine": "aquamarine", - "hyprcursor": "hyprcursor", - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_2", - "systems": "systems_2", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1725752806, - "narHash": "sha256-UwmsA7O9Wofu6YWldyR8NDv1bzxNICIg85/uOrVq69Y=", - "ref": "refs/heads/main", - "rev": "312411fc7073143a8bf1fc3ba23ef403b7d15eee", - "revCount": 5195, - "submodules": true, - "type": "git", - "url": "https://github.com/hyprwm/Hyprland" - }, - "original": { - "submodules": true, - "type": "git", - "url": "https://github.com/hyprwm/Hyprland" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hyprland", - "xdph", - "nixpkgs" - ], - "systems": [ - "hyprland", - "xdph", - "systems" - ] - }, - "locked": { - "lastModified": 1721326555, - "narHash": "sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "5a11232266bf1a1f5952d5b179c3f4b2facaaa84", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1725188252, - "narHash": "sha256-yBH8c4GDaEAtBrh+BqIlrx5vp6gG/Gu8fQQK63KAQgs=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "c12ab785ce1982f82594aff03b3104c598186ddd", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1724966483, - "narHash": "sha256-WXDgKIbzjYKczxSZOsJplCS1i1yrTUpsDPuJV/xpYLo=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "8976e3f6a5357da953a09511d0c7f6a890fb6ec2", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprwayland-scanner": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1721324119, - "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1718714799, @@ -494,22 +299,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1725634671, "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", @@ -525,7 +314,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1725194671, "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", @@ -546,8 +335,7 @@ "ags": "ags", "firefox-addons": "firefox-addons", "home-manager": "home-manager", - "hyprland": "hyprland", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "stylix": "stylix" } }, @@ -564,8 +352,8 @@ "flake-utils": "flake-utils_2", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_4", - "systems": "systems_3" + "nixpkgs": "nixpkgs_3", + "systems": "systems_2" }, "locked": { "lastModified": 1725290973, @@ -597,21 +385,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -625,36 +398,6 @@ "repo": "default", "type": "github" } - }, - "xdph": { - "inputs": { - "hyprland-protocols": "hyprland-protocols", - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1725203932, - "narHash": "sha256-VLULC/OnI+6R9KEP2OIGk+uLJJsfRlaLouZ5gyFd2+Y=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "2425e8f541525fa7409d9f26a8ffaf92a3767251", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7a0646d..1697e8a 100644 --- a/flake.nix +++ b/flake.nix @@ -4,15 +4,14 @@ ags.url = "github:Aylur/ags"; stylix.url = "github:danth/stylix"; - firefox-addons = { - url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; outputs = { diff --git a/modules/apps/helix/default.nix b/modules/apps/helix/default.nix index f0cd3eb..1f20b92 100644 --- a/modules/apps/helix/default.nix +++ b/modules/apps/helix/default.nix @@ -1,4 +1,8 @@ -{pkgs,lib, ...}: { +{ + pkgs, + lib, + ... +}: { home-manager.users.joy.programs.helix = { enable = true; defaultEditor = true; diff --git a/modules/hypr/hyprland/default.nix b/modules/hypr/hyprland/default.nix index 1789e98..d5eb555 100644 --- a/modules/hypr/hyprland/default.nix +++ b/modules/hypr/hyprland/default.nix @@ -1,7 +1,7 @@ -{ - pkgs, - ... -}: { +{pkgs, ...}: { + programs.hyprland = { + enable = true; + }; home-manager.users.joy = { home.packages = with pkgs; [ rofi-wayland @@ -16,180 +16,154 @@ playerctl ]; - programs.hyprland = { - enable = true; - }; - - services.cliphist.enable = true; - - wayland.windowManager.hyprland = { - enable = true; - settings = { - "$mod" = "SUPER"; - "$sciPath" = "~/nix/modules/hypr/hyprland/scripts"; - - cursor = { - inactive_timeout = "3"; - }; - - env = [ - "HYPRCURSOR_THEME = Bibata-Modern-Ice" - "HYPRCURSOR_SIZE = 24" - "NIXOS_OZONE_WL = 1" - ]; - - xwayland = { - force_zero_scaling = true; - }; - - monitor = [ - "DP-1,2560x1440@165.00Hz,auto,1,bitdepth,10" - "eDP-1,prefrered,auto,1" - "HDMI-A-1,prefrered,auto,1,mirror,eDP-1" - ]; - - exec-once = [ - "ags" - ]; - - windowrule = [ - "float,title:^(Pipewire)(.*)$" - "float,title:^(Disks)(.*)$" - "float,title:^(Calculator)(.*)$" - "float,title:^(Bluetooth)(.*)$" - "float,title:^(Clocks)(.*)$" - "float,title:^(Network Connections)(.*)$" - "opacity 0.9,^(Alacritty)(.*)$" - ]; - - gestures = { - workspace_swipe = true; - workspace_swipe_forever = true; - workspace_swipe_distance = 200; - }; - - general = { - gaps_in = 5; - gaps_out = 10; - border_size = 4; - allow_tearing = false; - layout = "master"; - }; - - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - }; - - decoration = { - rounding = 5; - }; - - input = { - kb_layout = "us,de"; - kb_variant = ",qwerty"; - kb_options = "grp:alt_shift_toggle,caps:swapescape"; - }; + services.cliphist.enable = true; + wayland.windowManager.hyprland = { + enable = true; + settings = { + "$mod" = "SUPER"; + "$sciPath" = "~/nix/modules/hypr/hyprland/scripts"; + cursor = { + inactive_timeout = "3"; + }; + env = [ + "HYPRCURSOR_THEME = Bibata-Modern-Ice" + "HYPRCURSOR_SIZE = 24" + "NIXOS_OZONE_WL = 1" + ]; + xwayland = { + force_zero_scaling = true; + }; + monitor = [ + "DP-1,2560x1440@165.00Hz,auto,1,bitdepth,10" + "eDP-1,prefrered,auto,1" + "HDMI-A-1,prefrered,auto,1,mirror,eDP-1" + ]; + exec-once = [ + "ags" + ]; + windowrule = [ + "float,title:^(Pipewire)(.*)$" + "float,title:^(Disks)(.*)$" + "float,title:^(Calculator)(.*)$" + "float,title:^(Bluetooth)(.*)$" + "float,title:^(Clocks)(.*)$" + "float,title:^(Network Connections)(.*)$" + "opacity 0.9,^(Alacritty)(.*)$" + ]; + gestures = { + workspace_swipe = true; + workspace_swipe_forever = true; + workspace_swipe_distance = 200; + }; + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 4; + allow_tearing = false; + layout = "master"; + }; + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + decoration = { + rounding = 5; + }; + input = { + kb_layout = "us,de"; + kb_variant = ",qwerty"; + kb_options = "grp:alt_shift_toggle,caps:swapescape"; + }; device = { name = "at-translated-set-2-keyboard"; repeat_rate = "50"; - - bind = [ - # launch Apps - "$mod,TAB, exec, alacritty" - "$mod, E, exec, nemo" - "$mod, S, exec, firefox" - "$mod, X, exec, keepassxc" - "$mod, M, exec, mw -Y && alacritty -e neomutt" - "$mod, N, exec, alacritty -e newsboat" - "$mod, A, exec, rofi -show drun" - "$mod, F, exec, freetube" - "$mod, C, exec, hyprpicker -a" - "$mod+Shift, W, exec, sh $sciPath/vm.sh" - "$mod+Shift, Z, exec, grim - | swappy -f -" - "$mod, Z, exec, sh $sciPath/screen.sh" - "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" - "$mod, O, exec, sh $sciPath/mpv.sh" - - # controles - "$mod, Q, killactive" - "$mod, W, togglefloating" - "$mod, R, togglesplit" - "$mod+shift, S, exec, systemctl suspend" - "$mod+shift, M, exit, hyprland" - "$mod, G, exec, sh $sciPath/gamemode.sh" - "$mod+shift, B, exec, sh $sciPath/ags.sh" - "$mod, up, exec, sh $sciPath/volume.sh -i" - "$mod, down, exec, sh $sciPath/volume.sh -d" - "$mod, P, exec, hyprctl dispatch togglefloating && hyprctl dispatch pin" - - # cmus - "$mod, D, exec, sh $sciPath/cmus.sh" - "$mod, space, exec, playerctl play-pause" - "$mod, comma, exec, playerctl previous" - "$mod, period, exec, playerctl next" - "$mod, equal, exec, cmus-remote -v +10%" - "$mod, minus, exec, cmus-remote -v -10%" - - # Move focus - "$mod, Return, fullscreen" - "$mod, H, movefocus, l" - "$mod, L, movefocus, r" - "$mod, K, movefocus, u" - "$mod, J, movefocus, d" - - # Window resizing X Y - "CTRL+SHIFT, H, resizeactive, -60 0" - "CTRL+SHIFT, L, resizeactive, 60 0" - "CTRL+SHIFT, K, resizeactive, 0 -60" - "CTRL+SHIFT, J, resizeactive, 0 60" - - # Moving windows - "$mod SHIFT, H, swapwindow, l" - "$mod SHIFT, L, swapwindow, r" - "$mod SHIFT, K, swapwindow, u" - "$mod SHIFT, J, swapwindow, d" - - # Switch workspaces - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - # Move active window to a workspace - "$mod+Shift, 1, movetoworkspace, 1" - "$mod+Shift, 2, movetoworkspace, 2" - "$mod+Shift, 3, movetoworkspace, 3" - "$mod+Shift, 4, movetoworkspace, 4" - "$mod+Shift, 5, movetoworkspace, 5" - "$mod+Shift, 6, movetoworkspace, 6" - "$mod+Shift, 7, movetoworkspace, 7" - "$mod+Shift, 8, movetoworkspace, 8" - "$mod+Shift, 9, movetoworkspace, 9" - "$mod+Shift, 0, movetoworkspace, 10" - ]; - - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - - bindl = [ - ", XF86MonBrightnessUp, exec, brightnessctl set +10%" - ", XF86MonBrightnessDown, exec, brightnessctl set 10%-" - ", XF86AudioRaiseVolume, exec, sh $sciPath/volume.sh -i" - ", XF86AudioLowerVolume, exec, sh $sciPath/volume.sh -d" - ", XF86AudioMute, exec, sh $sciPath/volume.sh -m" - ", XF86AudioMicMute, exec, sh $sciPath/volume.sh -t" - ", XF86PowerOff, exec, sh $sciPath/rick.sh" - ]; + bind = [ + # launch Apps + "$mod,TAB, exec, alacritty" + "$mod, E, exec, nemo" + "$mod, S, exec, firefox" + "$mod, X, exec, keepassxc" + "$mod, M, exec, mw -Y && alacritty -e neomutt" + "$mod, N, exec, alacritty -e newsboat" + "$mod, A, exec, rofi -show drun" + "$mod, F, exec, freetube" + "$mod, C, exec, hyprpicker -a" + "$mod+Shift, W, exec, sh $sciPath/vm.sh" + "$mod+Shift, Z, exec, grim - | swappy -f -" + "$mod, Z, exec, sh $sciPath/screen.sh" + "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + "$mod, O, exec, sh $sciPath/mpv.sh" + # controles + "$mod, Q, killactive" + "$mod, W, togglefloating" + "$mod, R, togglesplit" + "$mod+shift, S, exec, systemctl suspend" + "$mod+shift, M, exit, hyprland" + "$mod, G, exec, sh $sciPath/gamemode.sh" + "$mod+shift, B, exec, sh $sciPath/ags.sh" + "$mod, up, exec, sh $sciPath/volume.sh -i" + "$mod, down, exec, sh $sciPath/volume.sh -d" + "$mod, P, exec, hyprctl dispatch togglefloating && hyprctl dispatch pin" + # cmus + "$mod, D, exec, sh $sciPath/cmus.sh" + "$mod, space, exec, playerctl play-pause" + "$mod, comma, exec, playerctl previous" + "$mod, period, exec, playerctl next" + "$mod, equal, exec, cmus-remote -v +10%" + "$mod, minus, exec, cmus-remote -v -10%" + # Move focus + "$mod, Return, fullscreen" + "$mod, H, movefocus, l" + "$mod, L, movefocus, r" + "$mod, K, movefocus, u" + "$mod, J, movefocus, d" + # Window resizing X Y + "CTRL+SHIFT, H, resizeactive, -60 0" + "CTRL+SHIFT, L, resizeactive, 60 0" + "CTRL+SHIFT, K, resizeactive, 0 -60" + "CTRL+SHIFT, J, resizeactive, 0 60" + # Moving windows + "$mod SHIFT, H, swapwindow, l" + "$mod SHIFT, L, swapwindow, r" + "$mod SHIFT, K, swapwindow, u" + "$mod SHIFT, J, swapwindow, d" + # Switch workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + # Move active window to a workspace + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + ]; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + bindl = [ + ", XF86MonBrightnessUp, exec, brightnessctl set +10%" + ", XF86MonBrightnessDown, exec, brightnessctl set 10%-" + ", XF86AudioRaiseVolume, exec, sh $sciPath/volume.sh -i" + ", XF86AudioLowerVolume, exec, sh $sciPath/volume.sh -d" + ", XF86AudioMute, exec, sh $sciPath/volume.sh -m" + ", XF86AudioMicMute, exec, sh $sciPath/volume.sh -t" + ", XF86PowerOff, exec, sh $sciPath/rick.sh" + ]; }; }; }; diff --git a/modules/system/homemanger/default.nix b/modules/system/homemanger/default.nix index e7fb9e1..1393433 100644 --- a/modules/system/homemanger/default.nix +++ b/modules/system/homemanger/default.nix @@ -2,10 +2,10 @@ home-manager.users.joy.programs.home-manager.enable = true; home-manager.users.joy.xresources.path = ".config/.Xresources"; home-manager.users.joy.gtk.gtk2.configLocation = "/home/joy/.config/gtk-2.0/gtkrc"; - home-manager.users.joy.xdg = { - mimeApps = { - enable = true; - defaultApplications = { + home-manager.users.joy.xdg = { + mimeApps = { + enable = true; + defaultApplications = { "text/plain" = ["hx.desktop"]; "image/*" = ["imv.desktop"]; "video/png" = ["mpv.desktop"];