diff --git a/ahrc-laptop/home.nix b/ahrc-laptop/home.nix index efb9b55..396dcb5 100644 --- a/ahrc-laptop/home.nix +++ b/ahrc-laptop/home.nix @@ -1,173 +1,26 @@ { config, pkgs, ... }: { - home.username = "ahurac"; - home.homeDirectory = "/home/ahurac"; + imports = [ ../common/home.nix ]; home.stateVersion = "24.05"; - home.packages = with pkgs; [ - pavucontrol - thunderbird - wl-clipboard - swayosd - prismlauncher - anyrun - noto-fonts - libreoffice - mosh - webcord - element-desktop - joplin-desktop - gnumake - man-pages - man-pages-posix - clang-tools - gdb - gcc - valgrind - weston - nixfmt-classic - - (nerdfonts.override { fonts = [ "Hack" ]; }) - ]; - - home.sessionVariables = { - EDITOR = "hx"; - # XDG_DATA_DIRS = - # "${XDG_DATA_DIRS}:/usr/share:/var/lib/flatpak/exports/share:${HOME}/.local/share/flatpak/exports/share"; - }; - - gtk = { - enable = true; - theme = { - package = pkgs.adw-gtk3; - name = "adw-gtk3-dark"; - }; - iconTheme = { - package = pkgs.adwaita-icon-theme; - name = "Adwaita"; - }; - }; - - programs.home-manager.enable = true; - programs.firefox.enable = true; - programs.kitty.enable = true; - programs.hyprlock.enable = true; - - programs.helix = { - enable = true; - package = pkgs.evil-helix; - languages.language = [ - { - name = "nix"; - auto-format = true; - formatter.command = "nixfmt"; - } - { - name = "c"; - auto-format = true; - formatter.command = "clang-format"; - } - ]; - }; - - programs.rbw = { - enable = true; - settings = { - email = "hchauvin@mailbox.org"; - base_url = "https://vw.ahur.ac"; - pinentry = pkgs.pinentry-curses; - }; - }; - - fonts.fontconfig.enable = true; - fonts.fontconfig.defaultFonts = { - sansSerif = [ "Noto Sans" ]; - monospace = [ "Hack Nerd Font" ]; - emoji = [ "Noto Color Emoji" ]; - }; - - home.pointerCursor = { - name = "Bibata-Modern-Ice"; - package = pkgs.bibata-cursors; - size = 24; - gtk.enable = true; - }; - - programs.git = { - enable = true; - aliases = { - a = "add"; - c = "commit"; - s = "status"; - d = "diff"; - ch = "checkout"; - r = "restore"; - re = "reset"; - p = "pull"; - pu = "push"; - m = "merge"; - l = "log"; - graph = "log --graph --oneline"; - sh = "show"; - ds = "diff --staged"; - }; - userEmail = "ahurac@mailbox.org"; - userName = "Ahurac"; - extraConfig = { - init.defaultBranch = "main"; - push.autoSetupRemote = true; - }; - }; - programs.zsh = { - enable = true; - shellAliases = { - g = "git"; - j = "jobs"; - }; localVariables = { PROMPT = '' ╭─(%F{green}%B%n@%m%f%b)──(%F{blue}%B%50<...<%5~%<<%b%f)──(%B%?%b) ╰─(%B%j%b%# ''; }; - plugins = [{ - name = "vi-mode"; - src = pkgs.zsh-vi-mode; - file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; - }]; }; wayland.windowManager.hyprland = { - enable = true; - plugins = [ pkgs.hyprlandPlugins.hy3 ]; settings = { - monitor = ", highrr, 0x0, 1"; - - "$terminal" = "kitty"; - "$browser" = "firefox"; - "$locker" = "hyprlock"; - "$launcher" = "anyrun"; - "$joplin" = ""; - "$matrix_client" = ""; - "$discord" = ""; - "$deezer" = ""; - "$col_accentdark" = "rgb(00ff00)"; "$col_accentlight" = "rgb(80ff80)"; "$col_inactive" = "rgba(80808040)"; "$col_urgent" = "rgb(ffd966)"; animations = { enabled = false; }; - binds = { - scroll_event_delay = 0; - workspace_back_and_forth = false; - allow_workspace_cycles = false; - workspace_center_on = 1; - focus_preferred_method = 1; - movefocus_cycles_fullscreen = false; - }; decoration = { rounding = 10; active_opacity = 1.0; @@ -177,136 +30,12 @@ dim_inactive = false; blur.enabled = false; }; - general = { - border_size = 2; - "col.inactive_border" = "$col_inactive"; - "col.nogroup_border" = "$col_inactive"; - "col.active_border" = "$col_accentdark $col_accentlight 90deg"; - resize_on_border = false; - gaps_in = 5; - gaps_out = 10; - gaps_workspaces = 0; - layout = "hy3"; - no_focus_fallback = true; - }; gestures.workspace_swipe = true; - input = { - kb_layout = "fr"; - numlock_by_default = true; - repeat_rate = 75; - repeat_delay = 300; - kb_options = "compose:rctrl"; - sensitivity = 0.0; - accel_profile = "flat"; - touchpad = { - disable_while_typing = false; - natural_scroll = true; - }; + input.touchpad = { + disable_while_typing = false; + natural_scroll = true; }; - misc = { - disable_hyprland_logo = false; - disable_splash_rendering = false; - layers_hog_keyboard_focus = true; - mouse_move_focuses_monitor = true; - enable_swallow = false; - close_special_on_empty = true; - new_window_takes_over_fullscreen = 2; - animate_manual_resizes = false; - }; - plugin.hy3 = { - no_gaps_when_only = false; - node_collapse_policy = 0; - tabs = { - height = 5; - padding = 5; - from_top = true; - rounding = 4; - render_text = false; - "col.active" = "$col_accentdark"; - "col.urgent" = "$col_urgent"; - "col.inactive" = "$col_inactive"; - }; - autotile.enable = true; - }; - xwayland = { force_zero_scaling = true; }; - - env = [ - "QT_QPA_PLATFORM, wayland" - "QT_QPA_PLATFORM, qt6ct" - "QT_AUTO_SCREEN_SCALE_FACTOR, 1" - "QT_WAYLAND_DISABLE_WINDOWDECORATION, 1" - "CLUTTER_BACKEND, wayland" - "SDL_VIDEODRIVER, wayland" - "ELM_DISPLAY, wl" - "_JAVA_AWT_WM_NONREPARENTING, 1" - "XDG_SESSION_DESKTOP, Hyprland" - "ELECTRON_OZONE_PLATFORM_HINT, auto" - "HYPRCURSOR_THEME, bibata_modern_ice-hyprcursor" - ]; - - bind = [ - "SUPER, Space, exec, $terminal" - "SUPER SHIFT, Space, exec, $terminal -e sudo -i" - "SUPER, equal, movetoworkspace, special" - "SUPER, 10, workspace, 1" - "SUPER, 11, workspace, 2" - "SUPER, 12, workspace, 3" - "SUPER, 13, workspace, 4" - "SUPER, R, workspace, 5" - "SUPER, F, workspace, 6" - "SUPER, V, workspace, 7" - "SUPER, C, workspace, 8" - "SUPER, X, workspace, 9" - "SUPER, W, workspace, 10" - "SUPER, mouse_down, workspace, e-1" - "SUPER, mouse_up, workspace, e+1" - "SUPER SHIFT, Q, hy3:killactive" - "SUPER SHIFT, 10, movetoworkspacesilent, 1" - "SUPER SHIFT, 11, movetoworkspacesilent, 2" - "SUPER SHIFT, 12, movetoworkspacesilent, 3" - "SUPER SHIFT, 13, movetoworkspacesilent, 4" - "SUPER SHIFT, R, movetoworkspacesilent, 5" - "SUPER SHIFT, F, movetoworkspacesilent, 6" - "SUPER SHIFT, V, movetoworkspacesilent, 7" - "SUPER SHIFT, C, movetoworkspacesilent, 8" - "SUPER SHIFT, X, movetoworkspacesilent, 9" - "SUPER SHIFT, W, movetoworkspacesilent, 10" - "SUPER SHIFT, A, hy3:movewindow, l" - "SUPER SHIFT, Z, hy3:movewindow, u" - "SUPER SHIFT, S, hy3:movewindow, d" - "SUPER SHIFT, D, hy3:movewindow, r" - "SUPER SHIFT, Return, togglefloating" - "SUPER Alt_L, F, fullscreen" - "SUPER, A, hy3:movefocus, l" - "SUPER, Z, hy3:movefocus, u" - "SUPER, S, hy3:movefocus, d" - "SUPER, D, hy3:movefocus, r" - "SUPER, Q, hy3:makegroup, tab, force_ephemeral" - "SUPER, E, hy3:changegroup, opposite" - "SUPER, B, hy3:changegroup, toggletab" - "SUPER SHIFT, BackSpace, exit" - "SUPER, F1, exec, $launcher" - "SUPER, F2, exec, $joplin" - "SUPER, F3, exec, $matrix_client" - "SUPER, F4, exec, $discord" - "SUPER, F5, exec, $deezer" - "SUPER, G, exec, $browser" - "SUPER, L, exec, $locker" - ]; - bindm = - [ "SUPER, mouse:272, movewindow" "SUPER, mouse:273, resizewindow" ]; - bindn = [ - ", mouse:272, hy3:focustab, mouse" - ", mouse_up, hy3:focustab, r, require_hovered, wrap" - ", mouse_down, hy3:focustab, l, require_hovered, wrap" - ]; - bindel = [ - ", XF86AudioRaiseVolume, exec, swayosd-client --output-volume=raise" - ", XF86AudioLowerVolume, exec, swayosd-client --output-volume=lower" - ", XF86AudioMute, exec, swayosd-client --output-volume=mute-toggle" - ", XF86MonBrightnessUp, exec, swayosd-client --brightness=up" - ", XF86MonBrightnessDown, exec, swayosd-client --brightness=lower" - ]; + misc.animate_manual_resizes = false; }; }; } diff --git a/common/home.nix b/common/home.nix new file mode 100644 index 0000000..e36f5d6 --- /dev/null +++ b/common/home.nix @@ -0,0 +1,284 @@ +{ config, pkgs, ... }: + +{ + home.username = "ahurac"; + home.homeDirectory = "/home/ahurac"; + + home.stateVersion = "24.05"; + + home.packages = with pkgs; [ + pavucontrol + thunderbird + wl-clipboard + swayosd + prismlauncher + anyrun + noto-fonts + libreoffice + mosh + webcord + element-desktop + joplin-desktop + gnumake + man-pages + man-pages-posix + clang-tools + gdb + gcc + valgrind + weston + nixfmt-classic + + (nerdfonts.override { fonts = [ "Hack" ]; }) + ]; + + home.sessionVariables = { EDITOR = "hx"; }; + + gtk = { + enable = true; + theme = { + package = pkgs.adw-gtk3; + name = "adw-gtk3-dark"; + }; + iconTheme = { + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + }; + }; + + programs.home-manager.enable = true; + programs.firefox.enable = true; + programs.kitty.enable = true; + programs.hyprlock.enable = true; + + programs.helix = { + enable = true; + package = pkgs.evil-helix; + languages.language = [ + { + name = "nix"; + auto-format = true; + formatter.command = "nixfmt"; + } + { + name = "c"; + auto-format = true; + formatter.command = "clang-format"; + } + ]; + }; + + programs.rbw = { + enable = true; + settings = { + email = "hchauvin@mailbox.org"; + base_url = "https://vw.ahur.ac"; + pinentry = pkgs.pinentry-curses; + }; + }; + + fonts.fontconfig.enable = true; + fonts.fontconfig.defaultFonts = { + sansSerif = [ "Noto Sans" ]; + monospace = [ "Hack Nerd Font" ]; + emoji = [ "Noto Color Emoji" ]; + }; + + home.pointerCursor = { + name = "Bibata-Modern-Ice"; + package = pkgs.bibata-cursors; + size = 24; + gtk.enable = true; + }; + + programs.git = { + enable = true; + aliases = { + a = "add"; + c = "commit"; + s = "status"; + d = "diff"; + ch = "checkout"; + r = "restore"; + re = "reset"; + p = "pull"; + pu = "push"; + m = "merge"; + l = "log"; + graph = "log --graph --oneline"; + sh = "show"; + ds = "diff --staged"; + }; + userEmail = "ahurac@mailbox.org"; + userName = "Ahurac"; + extraConfig = { + init.defaultBranch = "main"; + push.autoSetupRemote = true; + }; + }; + + programs.zsh = { + enable = true; + shellAliases = { + g = "git"; + j = "jobs"; + }; + plugins = [{ + name = "vi-mode"; + src = pkgs.zsh-vi-mode; + file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; + }]; + }; + + wayland.windowManager.hyprland = { + enable = true; + plugins = [ pkgs.hyprlandPlugins.hy3 ]; + settings = { + monitor = ", highrr, 0x0, 1"; + + "$terminal" = "kitty"; + "$browser" = "firefox"; + "$locker" = "hyprlock"; + "$launcher" = "anyrun"; + "$joplin" = ""; + "$matrix_client" = ""; + "$discord" = ""; + "$deezer" = ""; + + exec-once = [ "swayosd-server" ]; + + binds = { + scroll_event_delay = 0; + workspace_back_and_forth = false; + allow_workspace_cycles = false; + workspace_center_on = 1; + focus_preferred_method = 1; + movefocus_cycles_fullscreen = false; + }; + general = { + border_size = 2; + "col.inactive_border" = "$col_inactive"; + "col.nogroup_border" = "$col_inactive"; + "col.active_border" = "$col_accentdark $col_accentlight 90deg"; + resize_on_border = false; + gaps_in = 5; + gaps_out = 10; + gaps_workspaces = 0; + layout = "hy3"; + no_focus_fallback = true; + }; + input = { + kb_layout = "fr"; + numlock_by_default = true; + repeat_rate = 75; + repeat_delay = 300; + kb_options = "compose:rctrl"; + sensitivity = 0.0; + accel_profile = "flat"; + }; + misc = { + disable_hyprland_logo = false; + disable_splash_rendering = false; + layers_hog_keyboard_focus = true; + mouse_move_focuses_monitor = true; + enable_swallow = false; + close_special_on_empty = true; + new_window_takes_over_fullscreen = 2; + }; + plugin.hy3 = { + no_gaps_when_only = false; + node_collapse_policy = 0; + tabs = { + height = 5; + padding = 5; + from_top = true; + rounding = 4; + render_text = false; + "col.active" = "$col_accentdark"; + "col.urgent" = "$col_urgent"; + "col.inactive" = "$col_inactive"; + }; + autotile.enable = true; + }; + xwayland = { force_zero_scaling = true; }; + + env = [ + "QT_QPA_PLATFORM, wayland" + "QT_QPA_PLATFORM, qt6ct" + "QT_AUTO_SCREEN_SCALE_FACTOR, 1" + "QT_WAYLAND_DISABLE_WINDOWDECORATION, 1" + "CLUTTER_BACKEND, wayland" + "SDL_VIDEODRIVER, wayland" + "ELM_DISPLAY, wl" + "_JAVA_AWT_WM_NONREPARENTING, 1" + "XDG_SESSION_DESKTOP, Hyprland" + "ELECTRON_OZONE_PLATFORM_HINT, auto" + "HYPRCURSOR_THEME, bibata_modern_ice-hyprcursor" + ]; + + bind = [ + "SUPER, Space, exec, $terminal" + "SUPER SHIFT, Space, exec, $terminal -e sudo -i" + "SUPER, equal, movetoworkspace, special" + "SUPER, 10, workspace, 1" + "SUPER, 11, workspace, 2" + "SUPER, 12, workspace, 3" + "SUPER, 13, workspace, 4" + "SUPER, R, workspace, 5" + "SUPER, F, workspace, 6" + "SUPER, V, workspace, 7" + "SUPER, C, workspace, 8" + "SUPER, X, workspace, 9" + "SUPER, W, workspace, 10" + "SUPER, mouse_down, workspace, e-1" + "SUPER, mouse_up, workspace, e+1" + "SUPER SHIFT, Q, hy3:killactive" + "SUPER SHIFT, 10, movetoworkspacesilent, 1" + "SUPER SHIFT, 11, movetoworkspacesilent, 2" + "SUPER SHIFT, 12, movetoworkspacesilent, 3" + "SUPER SHIFT, 13, movetoworkspacesilent, 4" + "SUPER SHIFT, R, movetoworkspacesilent, 5" + "SUPER SHIFT, F, movetoworkspacesilent, 6" + "SUPER SHIFT, V, movetoworkspacesilent, 7" + "SUPER SHIFT, C, movetoworkspacesilent, 8" + "SUPER SHIFT, X, movetoworkspacesilent, 9" + "SUPER SHIFT, W, movetoworkspacesilent, 10" + "SUPER SHIFT, A, hy3:movewindow, l" + "SUPER SHIFT, Z, hy3:movewindow, u" + "SUPER SHIFT, S, hy3:movewindow, d" + "SUPER SHIFT, D, hy3:movewindow, r" + "SUPER SHIFT, Return, togglefloating" + "SUPER Alt_L, F, fullscreen" + "SUPER, A, hy3:movefocus, l" + "SUPER, Z, hy3:movefocus, u" + "SUPER, S, hy3:movefocus, d" + "SUPER, D, hy3:movefocus, r" + "SUPER, Q, hy3:makegroup, tab, force_ephemeral" + "SUPER, E, hy3:changegroup, opposite" + "SUPER, B, hy3:changegroup, toggletab" + "SUPER SHIFT, BackSpace, exit" + "SUPER, F1, exec, $launcher" + "SUPER, F2, exec, $joplin" + "SUPER, F3, exec, $matrix_client" + "SUPER, F4, exec, $discord" + "SUPER, F5, exec, $deezer" + "SUPER, G, exec, $browser" + "SUPER, L, exec, $locker" + ]; + bindm = + [ "SUPER, mouse:272, movewindow" "SUPER, mouse:273, resizewindow" ]; + bindn = [ + ", mouse:272, hy3:focustab, mouse" + ", mouse_up, hy3:focustab, r, require_hovered, wrap" + ", mouse_down, hy3:focustab, l, require_hovered, wrap" + ]; + bindel = [ + ", XF86AudioRaiseVolume, exec, swayosd-client --output-volume=raise" + ", XF86AudioLowerVolume, exec, swayosd-client --output-volume=lower" + ", XF86AudioMute, exec, swayosd-client --output-volume=mute-toggle" + ", XF86MonBrightnessUp, exec, swayosd-client --brightness=up" + ", XF86MonBrightnessDown, exec, swayosd-client --brightness=lower" + ]; + }; + }; +}