feat(hyprland): added input options for reduced repeat_delay and increased repeat_speed

This commit is contained in:
Zhongheng Liu 2024-08-09 18:26:26 +08:00
commit 6d14dac991
No known key found for this signature in database
16 changed files with 300 additions and 259 deletions

View file

@ -45,6 +45,7 @@
home = { home = {
username = "${config.myUserName}"; username = "${config.myUserName}";
homeDirectory = "/home/${config.myUserName}"; homeDirectory = "/home/${config.myUserName}";
# copy wallpaper from assets
file = { file = {
"wallpaper.png".source = ./assets/gruvbox-wallpaper.png; "wallpaper.png".source = ./assets/gruvbox-wallpaper.png;
}; };
@ -53,6 +54,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
protonvpn-gui protonvpn-gui
devenv devenv
vlc
]; ];
programs.git = { programs.git = {
enable = true; enable = true;

View file

@ -1,9 +1,13 @@
{pkgs, config, lib, ...}:
{ {
imports = [ pkgs,
./hyprland.nix config,
./hyprpaper.nix lib,
./hypridle.nix ...
./hyprlock.nix }: {
]; imports = [
./hyprland.nix
./hyprpaper.nix
./hypridle.nix
./hyprlock.nix
];
} }

View file

@ -1,22 +1,20 @@
{pkgs, ...}: {pkgs, ...}: let
let timeoutSeconds = 60;
timeoutSeconds = 60; in {
in services.hypridle = {
{ enable = true;
services.hypridle = { settings = {
enable = true; general = {
settings = { after_sleep_cmd = "hyprctl dispatch dpms on";
general = { ignore_dbus_inhibit = false;
after_sleep_cmd = "hyprctl dispatch dpms on"; lock_cmd = "hyprlock";
ignore_dbus_inhibit = false; };
lock_cmd = "hyprlock"; listener = [
}; {
listener = [ timeout = timeoutSeconds;
{ on-timeout = "hyprlock";
timeout = timeoutSeconds; }
on-timeout = "hyprlock"; ];
} };
]; };
};
};
} }

View file

@ -1,60 +1,71 @@
{config, pkgs, ... }:
{ {
home.packages = with pkgs; [ config,
foot pkgs,
]; ...
wayland.windowManager.hyprland = { }: {
# Whether to enable Hyprland wayland compositor home.packages = with pkgs; [
enable = true; foot
# The hyprland package to use ];
package = pkgs.hyprland; wayland.windowManager.hyprland = {
plugins = with pkgs.hyprlandPlugins; [ # Whether to enable Hyprland wayland compositor
hyprbars enable = true;
hyprfocus # The hyprland package to use
csgo-vulkan-fix package = pkgs.hyprland;
]; plugins = with pkgs.hyprlandPlugins; [
# Whether to enable XWayland hyprbars
xwayland.enable = true; hyprfocus
settings = { csgo-vulkan-fix
misc = { ];
disable_hyprland_logo = true; # Whether to enable XWayland
disable_splash_rendering = true; xwayland.enable = true;
font_family = "monospace"; settings = {
}; input = {
"$mod" = "SUPER"; # xset rate 250 50 replacement on wayland...
bind = [ # FAST MODE LET'S GOOO
"$mod, Q, killactive" repeat_rate = 50;
"$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel" repeat_delay = 250;
# firefox quickstart };
"$mod, F, exec, ${pkgs.firefox}/bin/firefox" misc = {
# foot terminal disable_hyprland_logo = true;
"$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' zsh" disable_splash_rendering = true;
] ++ ( font_family = "monospace";
# workspaces };
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10} "$mod" = "SUPER";
builtins.concatLists (builtins.genList ( bind =
x: let [
ws = let "$mod, Q, killactive"
c = (x + 1) / 10; "$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel"
in # firefox quickstart
builtins.toString (x + 1 - (c * 10)); "$mod, F, exec, ${pkgs.firefox}/bin/firefox"
in [ # foot terminal
"$mod, ${ws}, workspace, ${toString (x + 1)}" "$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' zsh"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" ]
] ++ (
) # workspaces
10) # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
); builtins.concatLists (builtins.genList (
bindm = [ x: let
# mouse movements ws = let
"$mod, mouse:272, movewindow" c = (x + 1) / 10;
"$mod, mouse:273, resizewindow" in
"$mod ALT, mouse:272, resizewindow" builtins.toString (x + 1 - (c * 10));
]; in [
}; "$mod, ${ws}, workspace, ${toString (x + 1)}"
# Optional "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
# Whether to enable hyprland-session.target on hyprland startup ]
systemd.enable = true; )
}; 10)
# ... );
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
};
# Optional
# Whether to enable hyprland-session.target on hyprland startup
systemd.enable = true;
};
# ...
} }

View file

@ -1,39 +1,42 @@
{pkgs, config, lib, ...}:
{ {
programs.hyprlock = { pkgs,
enable = true; config,
settings = { lib,
general = { ...
disable_loading_bar = true; }: {
grace = 10; programs.hyprlock = {
hide_cursor = true; enable = true;
no_fade_in = false; settings = {
}; general = {
disable_loading_bar = true;
grace = 10;
hide_cursor = true;
no_fade_in = false;
};
background = [ background = [
{ {
path = "screenshot"; path = "screenshot";
blur_passes = 3; blur_passes = 3;
blur_size = 8; blur_size = 8;
} }
]; ];
input-field = [ input-field = [
{ {
size = "200, 50"; size = "200, 50";
position = "0, -80"; position = "0, -80";
monitor = ""; monitor = "";
dots_center = true; dots_center = true;
fade_on_empty = false; fade_on_empty = false;
font_color = "rgb(202, 211, 245)"; font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)"; inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)"; outer_color = "rgb(24, 25, 38)";
outline_thickness = 5; outline_thickness = 5;
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\'; #placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
shadow_passes = 2; shadow_passes = 2;
} }
]; ];
};
}; };
};
} }

View file

@ -1,12 +1,15 @@
{pkgs, config, ...}:
{ {
services.hyprpaper = { pkgs,
enable = true; config,
settings = { ...
ipc = "on"; }: {
splash = false; services.hyprpaper = {
preload = [ config.myWallPaperPathString ]; enable = true;
wallpaper = [ ",${config.myWallPaperPathString}" ]; settings = {
}; ipc = "on";
}; splash = false;
preload = [config.myWallPaperPathString];
wallpaper = [",${config.myWallPaperPathString}"];
};
};
} }

View file

@ -1,10 +1,13 @@
{pkgs, lib, ...}:
{ {
wayland.windowManager.sway = { pkgs,
enable = true; lib,
config = rec { ...
modifier = "Mod4"; }: {
terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh"; wayland.windowManager.sway = {
}; enable = true;
}; config = rec {
modifier = "Mod4";
terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh";
};
};
} }

View file

@ -1,15 +1,20 @@
{pkgs, config, lib, ...}:
{ {
options = with lib; with types; { pkgs,
myWallPaperPathString = mkOption { type = str; }; config,
myUserName = mkOption { type = str; }; lib,
myDisplayName = mkOption { type = str; }; ...
myEmail = mkOption { type = str; }; }: {
}; options = with lib;
config = rec { with types; {
myUserName = "stvnliu"; myWallPaperPathString = mkOption {type = str;};
myWallPaperPathString = "/home/${config.myUserName}/wallpaper.png"; myUserName = mkOption {type = str;};
myDisplayName = "Zhongheng Liu"; myDisplayName = mkOption {type = str;};
myEmail = "z.liu@outlook.com.gr"; myEmail = mkOption {type = str;};
}; };
config = rec {
myUserName = "stvnliu";
myWallPaperPathString = "/home/${config.myUserName}/wallpaper.png";
myDisplayName = "Zhongheng Liu";
myEmail = "z.liu@outlook.com.gr";
};
} }

View file

@ -15,7 +15,7 @@
./services/laptop.preset.nix ./services/laptop.preset.nix
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
boot.supportedFilesystems = ["ntfs"];
security.pam.services.hyprlock = {}; security.pam.services.hyprlock = {};
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;

View file

@ -1,4 +1,9 @@
{pkgs, config, lib, ...}: { {
pkgs,
config,
lib,
...
}: {
services.greetd = { services.greetd = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,30 +1,34 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
]; pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/f9ff609f-6e72-43cf-917c-3bd3fde6c410"; device = "/dev/disk/by-uuid/f9ff609f-6e72-43cf-917c-3bd3fde6c410";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/2E4F-3060"; device = "/dev/disk/by-uuid/2E4F-3060";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = ["fmask=0022" "dmask=0022"];
}; };
swapDevices = [ ]; swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,36 +1,36 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
specialisation = { specialisation = {
powersave.configuration = { powersave.configuration = {
hardware.nvidia.prime = { hardware.nvidia.prime = {
offload = { offload = {
enable = lib.mkForce true; enable = lib.mkForce true;
enableOffloadCmd = lib.mkForce true; enableOffloadCmd = lib.mkForce true;
}; };
sync.enable = lib.mkForce false; sync.enable = lib.mkForce false;
}; };
}; };
}; };
hardware.graphics.enable = true; hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = { hardware.nvidia = {
prime = { prime = {
offload.enable = false; offload.enable = false;
sync = { sync = {
enable = true; enable = true;
}; };
amdgpuBusId = "PCI:5:0:0"; amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0"; nvidiaBusId = "PCI:1:0:0";
}; };
forceFullCompositionPipeline = true; forceFullCompositionPipeline = true;
modesetting.enable = true; modesetting.enable = true;
powerManagement.enable = false; powerManagement.enable = false;
powerManagement.finegrained = false; powerManagement.finegrained = false;
# open = true; # open = true;
nvidiaSettings = true; nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
}; };
} }

View file

@ -1,8 +1,7 @@
{...}: {...}: {
{ imports = [
imports = [ ./nginx.service.nix
./nginx.service.nix ./pipewire.service.nix
./pipewire.service.nix ./syncthing.service.nix
./syncthing.service.nix ];
];
} }

View file

@ -1,21 +1,21 @@
{pkgs, ...}: { {pkgs, ...}: {
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa = { alsa = {
enable = true; enable = true;
support32Bit = true; support32Bit = true;
}; };
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
wireplumber.configPackages = [ wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
bluez_monitor.properties = { bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true, ["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true, ["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true, ["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
} }
'') '')
]; ];
}; };
} }

View file

@ -1,17 +1,17 @@
{ {
pkgs, pkgs,
config, config,
lib, lib,
... ...
}: { }: {
services = { services = {
syncthing = { syncthing = {
enable = true; enable = true;
user = "${config.myUserName}"; user = "${config.myUserName}";
dataDir = "/home/${config.myUserName}/Documents"; dataDir = "/home/${config.myUserName}/Documents";
configDir = "/home/${config.myUserName}/Documents/.config/syncthing"; configDir = "/home/${config.myUserName}/Documents/.config/syncthing";
}; };
}; };
networking.firewall.allowedTCPPorts = [8384 22000]; networking.firewall.allowedTCPPorts = [8384 22000];
networking.firewall.allowedUDPPorts = [22000 21027]; networking.firewall.allowedUDPPorts = [22000 21027];
} }

View file

@ -1,15 +1,19 @@
{config, pkgs, lib, ...}:
{ {
config,
# Type definitions for nix variables used in this configuration pkgs,
options = with lib; with types; { lib,
myUserName = mkOption { type = str; }; ...
myHostName = mkOption { type = str; }; }: {
}; # Type definitions for nix variables used in this configuration
options = with lib;
# Default values for this configuration with types; {
config = { myUserName = mkOption {type = str;};
myUserName = "stvnliu"; myHostName = mkOption {type = str;};
myHostName = "homelab-nix"; };
};
# Default values for this configuration
config = {
myUserName = "stvnliu";
myHostName = "homelab-nix";
};
} }