diff --git a/home.nix b/home.nix index 7fb69ad..6aa127c 100755 --- a/home.nix +++ b/home.nix @@ -6,6 +6,7 @@ { imports = [ ./home/kitty.nix + ./home/ssh.nix ./home/shell.nix ./home/starship.nix ./home/git.nix @@ -52,9 +53,13 @@ btop fastfetch + # Langs + php + go + nodejs_22 + bun + # Util - xclip - flameshot # Media mpc diff --git a/home/hyprland.nix b/home/hyprland.nix index 0732d86..d942f52 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -8,11 +8,15 @@ { home.packages = [ pkgs.wofi - pkgs.hyprlock - pkgs.hyprpaper + # pkgs.hyprlock + pkgs.mako + pkgs.libnotify ]; imports = [ + # Configs + ./hyprland/binds.nix + # Ecosystem ./hyprland/hyprpaper.nix ]; @@ -41,76 +45,10 @@ general = { layout = "master"; - gaps_out = 5; - gaps_in = 5; + gaps_out = 10; + gaps_in = 10; }; - bind = [ - # Start programs - "$mod, q, exec, $terminal" - "$mod SHIFT, o, exec, $browser" - "$mod SHIFT, p, exec, $browser --incognito" - "$mod, e, exec, $file_browser" - "$mod SHIFT, n, exec, kitty --start-as=normal -- bash -ic 'code ~/nix && exit'" - "$mod, RETURN, exec, $webapphttps://chatgpt.com" - - # Window and workspace navigation - # Move between windows with vim keys - "$mod, h, movefocus, l" - "$mod, l, movefocus, r" - "$mod, k, movefocus, u" - "$mod, j, movefocus, d" - "$mod, c, killactive" - # Move between workspaces - "$mod ALT, l, movetoworkspace, r+1" - "$mod ALT, h, movetoworkspace, r-1" - "$mod SHIFT, l, workspace, r+1" - "$mod SHIFT, h, workspace, r-1" - # Window management - "$mod, 0, layoutmsg, rollnext" - - "$mod, f, fullscreen, 0" - "$mod, v, togglefloating, active" - "$mod, SPACE, exec, wofi --show drun" - - # ", Print, exec, grimblast copy area" - - # "$mod, r, exec, kitty -- zsh -c 'exec yazi; exec zsh'" - # "$mod, b, exec, kitty -- zsh -c 'btop; exec zsh'" - # "$mod, y, exec, kitty --start-as=normal -- zsh -ic 'repos'" - # "$mod, i, exec, brave" - # "$mod, u, exec, kitty --start-as=normal -- zsh -ic 'home'" - - "$mod SHIFT, s, togglespecialworkspace, comms" - # "$mod, v, togglespecialworkspace, special2" - - # Log out - # "$mod, -, exec, hyprctl dispatch exit" - "$mod SHIFT ALT, x, exec, hyprctl dispatch exit" - - # Shift+Print → select area and copy - "SHIFT, Print, exec, grimblast copy area" - - # Ctrl+Print → select window and copy - "CTRL, Print, exec, grimblast copy active" - ] - ++ ( - # workspaces - # binds $mod + [shift +] {1..9} to [move to] workspace {1..9} - builtins.concatLists ( - builtins.genList ( - i: - let - ws = i + 1; - in - [ - "$mod, code:1${toString i}, workspace, ${toString ws}" - "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" - ] - ) 9 - ) - ); - workspace = [ 1 2 diff --git a/home/hyprland/binds.nix b/home/hyprland/binds.nix new file mode 100644 index 0000000..a7089c5 --- /dev/null +++ b/home/hyprland/binds.nix @@ -0,0 +1,80 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + "$browser" = "brave"; + "$terminal" = "kitty"; + "$file_browser" = "nautilus"; + "$webapp" = "$browser --new-window --app="; + + binds = { + drag_threshold = 10; + }; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + bind = [ + # Start programs + "$mod, q, exec, $terminal" + "$mod SHIFT, o, exec, $browser" + "$mod SHIFT, p, exec, $browser --incognito" + "$mod, e, exec, $file_browser" + "$mod SHIFT, n, exec, kitty --start-as=normal -- bash -ic 'code ~/nix && exit'" + "$mod, RETURN, exec, $webapphttps://chatgpt.com" + + # Window and workspace navigation + # Move between windows with vim keys + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + "$mod, c, killactive" + # Move between workspaces + "$mod ALT, l, movetoworkspace, r+1" + "$mod ALT, h, movetoworkspace, r-1" + "$mod SHIFT, l, workspace, r+1" + "$mod SHIFT, h, workspace, r-1" + # Window management + "$mod, 0, layoutmsg, rollnext" + + "$mod, f, fullscreen, 0" + "$mod, v, togglefloating, active" + "$mod, SPACE, exec, wofi --show drun" + + "$mod SHIFT, s, togglespecialworkspace, comms" + "$mod SHIFT ALT, x, exec, hyprctl dispatch exit" + "SHIFT, Print, exec, grimblast copy area" + "CTRL, Print, exec, grimblast copy active" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..9} to [move to] workspace {1..9} + builtins.concatLists ( + builtins.genList ( + i: + let + ws = i + 1; + in + [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" + ] + ) 9 + ) + ); + }; + + wayland.windowManager.hyprland.plugins = [ + # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars + ]; + +} diff --git a/home/hyprland/windowrules.nix b/home/hyprland/windowrules.nix new file mode 100644 index 0000000..e69de29 diff --git a/home/kitty.nix b/home/kitty.nix index aaacf70..a6f0287 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -10,7 +10,7 @@ let font_size 16.0 - background_opacity 0.9 + background_opacity 0.7 background_blur 1 hide_window_decorations yes diff --git a/home/shell.nix b/home/shell.nix index 844a1fe..c36e567 100755 --- a/home/shell.nix +++ b/home/shell.nix @@ -13,9 +13,7 @@ shellAliases = { sudo = "sudo "; # Better ls with eza - ls = "eza"; - ll = "eza -la"; - la = "eza -la"; + ls = "eza -lg --group-directories-first --icons"; tree = "eza --tree"; # Convenience diff --git a/home/ssh.nix b/home/ssh.nix new file mode 100644 index 0000000..85e6487 --- /dev/null +++ b/home/ssh.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ + # Enable SSH client and add to agent automatically + programs.ssh = { + enable = true; + addKeysToAgent = "yes"; + }; + + # Per-user ssh-agent (systemd --user) + services.ssh-agent.enable = true; + + # Systemd unit to load all private keys from ~/.ssh + systemd.user.services."ssh-add-all-keys" = { + Unit = { + Description = "Add all SSH keys from ~/.ssh to ssh-agent"; + After = [ "ssh-agent.service" ]; + Requires = [ "ssh-agent.service" ]; + }; + Service = { + Type = "oneshot"; + Environment = [ "SSH_ASKPASS_REQUIRE=prefer" ]; + ExecStart = '' + ${pkgs.openssh}/bin/ssh-add -q ~/.ssh/id_* 2>/dev/null || true + ''; + }; + Install.WantedBy = [ "default.target" ]; + }; +}