From 567a3790d5f74a209b70f3f32b4879b366e72c62 Mon Sep 17 00:00:00 2001 From: k Date: Sun, 27 Oct 2024 14:00:28 -0400 Subject: [PATCH 1/5] added zathura and mpv --- hosts/home/tile.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hosts/home/tile.nix b/hosts/home/tile.nix index b662fe4..1e09005 100644 --- a/hosts/home/tile.nix +++ b/hosts/home/tile.nix @@ -1,16 +1,12 @@ { config, pkgs, inputs, ... }: { - - services = { - mako = { enable = true; }; - }; - programs = { mako = { enable = true; }; alacritty = { enable = true; }; swaylock = {enable = true;}; wofi = { enable = true; }; + zathura = { enable = true; }; + mpv = { enable = true; }; }; -} - +} \ No newline at end of file From 4ffd2d8bfb39b78ebd2a2c4c2a97b6bf06868ecf Mon Sep 17 00:00:00 2001 From: k Date: Thu, 7 Nov 2024 13:52:12 -0500 Subject: [PATCH 2/5] update --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index fc4ec4e..d864d47 100644 --- a/flake.lock +++ b/flake.lock @@ -143,11 +143,11 @@ ] }, "locked": { - "lastModified": 1729027341, - "narHash": "sha256-IqWD7bA9iJVifvJlB4vs2KUXVhN+d9lECWdNB4jJ0tE=", + "lastModified": 1730837930, + "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", "owner": "nix-community", "repo": "home-manager", - "rev": "2a4fd1cfd8ed5648583dadef86966a8231024221", + "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", "type": "github" }, "original": { @@ -179,11 +179,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1728729581, - "narHash": "sha256-oazkQ/z7r43YkDLLQdMg8oIB3CwWNb+2ZrYOxtLEWTQ=", + "lastModified": 1730919458, + "narHash": "sha256-yMO0T0QJlmT/x4HEyvrCyigGrdYfIXX3e5gWqB64wLg=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "a8dd1b21995964b115b1e3ec639dd6ce24ab9806", + "rev": "e1cc1f6483393634aee94514186d21a4871e78d7", "type": "github" }, "original": { @@ -246,11 +246,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1728900372, - "narHash": "sha256-hmG/u7qZEm7CTh1XPDi+pg4Oi0nNrv7sL8PgZDRe6wg=", + "lastModified": 1731002033, + "narHash": "sha256-uGjTjvvlGQfQ0yypVP+at0NizI2nrb6kz4wGAqzRGbY=", "owner": "danth", "repo": "stylix", - "rev": "33a2eff15181e557bb6dd9d2073b90f7d218975d", + "rev": "f71c2effed1ce4f9fbeefe402e4e431428ffe93a", "type": "github" }, "original": { From d9a26695775a74bfa537e44bb51caf86664118cc Mon Sep 17 00:00:00 2001 From: k Date: Tue, 19 Nov 2024 22:01:50 -0500 Subject: [PATCH 3/5] Added Hyprland --- hosts/home/hyprland.nix | 133 +++++++++++++++++++++++++++++++++ hosts/laptop/configuration.nix | 5 ++ 2 files changed, 138 insertions(+) create mode 100644 hosts/home/hyprland.nix diff --git a/hosts/home/hyprland.nix b/hosts/home/hyprland.nix new file mode 100644 index 0000000..2704fe9 --- /dev/null +++ b/hosts/home/hyprland.nix @@ -0,0 +1,133 @@ +{ config, pkgs, inputs, ... }: + +{ + imports = [ ./waybar.nix ./tile.nix ]; + + wayland.windowManager.hyprland = { + enable = true; + systemd.variables = [ "--all" ]; + xwayland.enable = true; + settings = { + exec-once = [ "${pkgs.hyprpaper}/bin/hyprpaper" ]; + monitor = ",preferred,auto,1"; + general = { + "$mainMod" = "SUPER"; + layout = "master"; + "$terminal" = "${pkgs.alacritty}/bin/alacritty"; + "$menu" = "${pkgs.wofi}/bin/wofi --show drun"; + gaps_in = 5; + gaps_out = 10; + border_size = 2; + }; + + decoration = { + rounding = 15; + blur = { + enabled = true; + size = 2; + passes = 2; + brightness = 1; + noise = .3; + new_optimizations = true; + }; + drop_shadow = true; + }; + + misc = { + disable_autoreload = true; + disable_hyprland_logo = true; + always_follow_on_dnd = true; + layers_hog_keyboard_focus = true; + animate_manual_resizes = false; + enable_swallow = true; + focus_on_activate = true; + new_window_takes_over_fullscreen = 2; + middle_click_paste = true; + vfr = true; + }; + + bind = [ + # keybindings + "$mainMod, Return, exec, $terminal" + "$mainMod, D, exec, $menu" + "$mainMod Shift, C, killactive," + "$mainMod, Space, exec, toggle_float" + "$mainMod, Escape, exec, ${pkgs.hyprlock}/bin/hyprlock" + + # switch focus + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + + # switch workspace + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + + # same as above, but switch to the workspace + "$mainMod SHIFT, 1, movetoworkspacesilent, 1" # movetoworkspacesilent + "$mainMod SHIFT, 2, movetoworkspacesilent, 2" + "$mainMod SHIFT, 3, movetoworkspacesilent, 3" + "$mainMod SHIFT, 4, movetoworkspacesilent, 4" + "$mainMod SHIFT, 5, movetoworkspacesilent, 5" + "$mainMod SHIFT, 6, movetoworkspacesilent, 6" + "$mainMod SHIFT, 7, movetoworkspacesilent, 7" + "$mainMod SHIFT, 8, movetoworkspacesilent, 8" + "$mainMod SHIFT, 9, movetoworkspacesilent, 9" + "$mainMod SHIFT, 0, movetoworkspacesilent, 10" + "$mainMod CTRL, c, movetoworkspace, empty" + + # window control + "$mainMod SHIFT, left, movewindow, l" + "$mainMod SHIFT, right, movewindow, r" + "$mainMod SHIFT, up, movewindow, u" + "$mainMod SHIFT, down, movewindow, d" + "$mainMod CTRL, left, resizeactive, -80 0" + "$mainMod CTRL, right, resizeactive, 80 0" + "$mainMod CTRL, up, resizeactive, 0 -80" + "$mainMod CTRL, down, resizeactive, 0 80" + "$mainMod ALT, left, moveactive, -80 0" + "$mainMod ALT, right, moveactive, 80 0" + "$mainMod ALT, up, moveactive, 0 -80" + "$mainMod ALT, down, moveactive, 0 80" + + # media and volume controls + # ",XF86AudioMute,exec, pamixer -t" + ",XF86AudioPlay,exec, playerctl play-pause" + ",XF86AudioNext,exec, playerctl next" + ",XF86AudioPrev,exec, playerctl previous" + ",XF86AudioStop,exec, playerctl stop" + ]; + + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + windowrule = + [ "float,mpv" "center,mpv" "pin,wofi" "idleinhibit focus,mpv" ]; + + windowrulev2 = [ ]; + }; + }; + + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + MOZ_USE_XINPUT2 = "1"; + XDG_SESSION_TYPE = "wayland"; + SDL_VIDEODRIVER = "wayland"; + QT_QPA_PLATFORM = "wayland"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + _JAVA_AWT_WM_NONREPARENTING = 1; + }; +} + diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index c159ec5..60dd225 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -9,6 +9,7 @@ security.rtkit.enable = true; security.polkit.enable = true; security.pam.services.swaylock = {}; + security.pam.services.hyprlock = {}; powerManagement.enable = true; nix = { @@ -93,6 +94,7 @@ steam.enable = true; steam.gamescopeSession.enable = true; gamemode.enable = true; + hyprland.enable = true; }; users.users.k = { @@ -130,7 +132,10 @@ intel-vaapi-driver intel-compute-runtime intel-media-driver + vpl-gpu-rt microcodeIntel + mkl + embree neovim ]; }; From 1f1a29fb7c59b1ef29413f10a8365166951c89b4 Mon Sep 17 00:00:00 2001 From: k Date: Tue, 19 Nov 2024 22:02:07 -0500 Subject: [PATCH 4/5] Added mpd --- hosts/laptop/home.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 61841fa..4ce0ec5 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,7 +1,7 @@ { config, pkgs, inputs, ... }: { - imports = [ ../home/home_common.nix ../home/gnome.nix ../home/sway.nix ]; + imports = [ ../home/home_common.nix ../home/gnome.nix ../home/sway.nix ../home/hyprland.nix]; nixpkgs.config.allowUnfree = true; @@ -39,9 +39,15 @@ services = { syncthing.enable = true; activitywatch.enable = true; + + mpd = { + enable = true; + musicDirectory = "/home/k/Music"; + }; emacs = { enable = true; defaultEditor = true; + package = pkgs.emacs-gtk; }; }; stylix = { From 446e5ab59bc16752e8b1b652a421649dd7c14886 Mon Sep 17 00:00:00 2001 From: k Date: Tue, 19 Nov 2024 22:02:21 -0500 Subject: [PATCH 5/5] Fixes --- hosts/home/sway.nix | 2 +- hosts/home/tile.nix | 6 ++++-- hosts/home/waybar.nix | 41 ++++++++++++++++++++++++----------------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/hosts/home/sway.nix b/hosts/home/sway.nix index 2661bee..993dd0f 100644 --- a/hosts/home/sway.nix +++ b/hosts/home/sway.nix @@ -11,7 +11,7 @@ window.border = 1; window.titlebar = false; terminal = "${pkgs.alacritty}/bin/alacritty"; - menu = "${pkgs.wofi}/bin/wofi -show drun -modi drun"; + menu = "${pkgs.wofi}/bin/wofi --show drun"; bars = []; gaps = { inner = 10; diff --git a/hosts/home/tile.nix b/hosts/home/tile.nix index 1e09005..2de4e34 100644 --- a/hosts/home/tile.nix +++ b/hosts/home/tile.nix @@ -1,12 +1,14 @@ { config, pkgs, inputs, ... }: { - programs = { + services = { mako = { enable = true; }; + }; + programs = { alacritty = { enable = true; }; swaylock = {enable = true;}; wofi = { enable = true; }; zathura = { enable = true; }; mpv = { enable = true; }; }; -} \ No newline at end of file +} diff --git a/hosts/home/waybar.nix b/hosts/home/waybar.nix index 48b846b..990c55f 100644 --- a/hosts/home/waybar.nix +++ b/hosts/home/waybar.nix @@ -7,6 +7,9 @@ layer = "bottom"; position = "bottom"; output = [ "eDP-1" ]; + margin-left = 45; + margin-right = 45; + spacing = 15; modules-left = [ "sway/workspaces" "sway/mode" ]; modules-center = [ "clock" ]; @@ -26,16 +29,16 @@ "pulseaudio" = { format = "{volume}% {icon}"; - format-bluetooth = "{volume}% {icon}"; - format-muted = ""; + format-bluetooth = "{volume}% {icon} "; + format-muted = " "; format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ "" "" ]; + headphone = " "; + hands-free = " "; + headset = " "; + phone = " "; + portable = " "; + car = " "; + default = [ " " " " ]; }; scroll-step = 1; on-click = "pavucontrol"; @@ -51,22 +54,26 @@ network = { format = "{ifname}"; - format-wifi = "{essid} ({signalStrength}%) "; - format-ethernet = "{ipaddr}/{cidr} 󰊗"; - format-disconnected = "󰤮"; - tooltip-format = "{ifname} via {gwaddr} 󰊗"; - tooltip-format-wifi = "{essid} ({signalStrength}%) "; - tooltip-format-ethernet = "{ifname} "; + format-wifi = "{essid} ({signalStrength}%)  "; + format-ethernet = "{ipaddr}/{cidr} 󰊗 "; + format-disconnected = "󰤮 "; + tooltip-format = "{ifname} via {gwaddr} 󰊗 "; + tooltip-format-wifi = "{essid} ({signalStrength}%)  "; + tooltip-format-ethernet = "{ifname}  "; tooltip-format-disconnected = "Disconnected"; max-length = 50; }; battery = { format = "{capacity}% {icon}"; - "format-icons" = [ "" "" "" "" "" ]; + "format-icons" = [ " " " " " " " " " " ]; }; - clock = { "format-alt" = "{:%a, %d. %b %H:%M}"; }; + clock = { + format = "{:%I:%M %p}"; + "format-alt" = "{:%a, %d. %b %H:%M}"; + tooltip = false; + }; }; }; };