diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-08-09 18:26:26 +0800 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-08-09 18:26:26 +0800 |
commit | 6d14dac99165360c241eb3cca5536cfa1aca71e8 (patch) | |
tree | 002853580592d7a8b1cc6b1161ac32618aad1e20 | |
parent | 9e44996afdfa967accf5b98ed4f93258fc58a4df (diff) | |
download | nixos-configuration-6d14dac99165360c241eb3cca5536cfa1aca71e8.tar.gz nixos-configuration-6d14dac99165360c241eb3cca5536cfa1aca71e8.tar.bz2 nixos-configuration-6d14dac99165360c241eb3cca5536cfa1aca71e8.zip |
feat(hyprland): added input options for reduced repeat_delay and increased repeat_speed
-rw-r--r-- | home-manager/stvnliu/home.nix | 2 | ||||
-rw-r--r-- | home-manager/stvnliu/hypr/default.nix | 18 | ||||
-rw-r--r-- | home-manager/stvnliu/hypr/hypridle.nix | 40 | ||||
-rw-r--r-- | home-manager/stvnliu/hypr/hyprland.nix | 127 | ||||
-rw-r--r-- | home-manager/stvnliu/hypr/hyprlock.nix | 73 | ||||
-rw-r--r-- | home-manager/stvnliu/hypr/hyprpaper.nix | 23 | ||||
-rw-r--r-- | home-manager/stvnliu/swaywm.nix | 19 | ||||
-rw-r--r-- | home-manager/stvnliu/variables.nix | 31 | ||||
-rw-r--r-- | nixos/configuration.nix | 2 | ||||
-rw-r--r-- | nixos/greetd-sway.nix | 7 | ||||
-rw-r--r-- | nixos/hardware-configuration.nix | 42 | ||||
-rw-r--r-- | nixos/nvidia.nix | 66 | ||||
-rw-r--r-- | nixos/services/laptop.preset.nix | 13 | ||||
-rw-r--r-- | nixos/services/pipewire.service.nix | 38 | ||||
-rw-r--r-- | nixos/services/syncthing.service.nix | 28 | ||||
-rw-r--r-- | nixos/variables.nix | 30 |
16 files changed, 300 insertions, 259 deletions
diff --git a/home-manager/stvnliu/home.nix b/home-manager/stvnliu/home.nix index 06eb48f..56594d6 100644 --- a/home-manager/stvnliu/home.nix +++ b/home-manager/stvnliu/home.nix @@ -45,6 +45,7 @@ home = { username = "${config.myUserName}"; homeDirectory = "/home/${config.myUserName}"; + # copy wallpaper from assets file = { "wallpaper.png".source = ./assets/gruvbox-wallpaper.png; }; @@ -53,6 +54,7 @@ home.packages = with pkgs; [ protonvpn-gui devenv + vlc ]; programs.git = { enable = true; diff --git a/home-manager/stvnliu/hypr/default.nix b/home-manager/stvnliu/hypr/default.nix index 9498742..b23406f 100644 --- a/home-manager/stvnliu/hypr/default.nix +++ b/home-manager/stvnliu/hypr/default.nix @@ -1,9 +1,13 @@ -{pkgs, config, lib, ...}: { - imports = [ - ./hyprland.nix - ./hyprpaper.nix - ./hypridle.nix - ./hyprlock.nix - ]; + pkgs, + config, + lib, + ... +}: { + imports = [ + ./hyprland.nix + ./hyprpaper.nix + ./hypridle.nix + ./hyprlock.nix + ]; } diff --git a/home-manager/stvnliu/hypr/hypridle.nix b/home-manager/stvnliu/hypr/hypridle.nix index 4f5b8ae..5b5da02 100644 --- a/home-manager/stvnliu/hypr/hypridle.nix +++ b/home-manager/stvnliu/hypr/hypridle.nix @@ -1,22 +1,20 @@ -{pkgs, ...}: -let - timeoutSeconds = 60; -in -{ - services.hypridle = { - enable = true; - settings = { - general = { - after_sleep_cmd = "hyprctl dispatch dpms on"; - ignore_dbus_inhibit = false; - lock_cmd = "hyprlock"; - }; - listener = [ - { - timeout = timeoutSeconds; - on-timeout = "hyprlock"; - } - ]; - }; - }; +{pkgs, ...}: let + timeoutSeconds = 60; +in { + services.hypridle = { + enable = true; + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + listener = [ + { + timeout = timeoutSeconds; + on-timeout = "hyprlock"; + } + ]; + }; + }; } diff --git a/home-manager/stvnliu/hypr/hyprland.nix b/home-manager/stvnliu/hypr/hyprland.nix index fc6ff43..b686001 100644 --- a/home-manager/stvnliu/hypr/hyprland.nix +++ b/home-manager/stvnliu/hypr/hyprland.nix @@ -1,60 +1,71 @@ -{config, pkgs, ... }: { - home.packages = with pkgs; [ - foot - ]; - wayland.windowManager.hyprland = { -# Whether to enable Hyprland wayland compositor - enable = true; -# The hyprland package to use - package = pkgs.hyprland; - plugins = with pkgs.hyprlandPlugins; [ - hyprbars - hyprfocus - csgo-vulkan-fix - ]; -# Whether to enable XWayland - xwayland.enable = true; - settings = { - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - font_family = "monospace"; - }; - "$mod" = "SUPER"; - bind = [ - "$mod, Q, killactive" - "$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel" - # firefox quickstart - "$mod, F, exec, ${pkgs.firefox}/bin/firefox" - # foot terminal - "$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' zsh" - ] ++ ( -# workspaces -# binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in [ - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - ] - ) - 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; - }; -# ... + config, + pkgs, + ... +}: { + home.packages = with pkgs; [ + foot + ]; + wayland.windowManager.hyprland = { + # Whether to enable Hyprland wayland compositor + enable = true; + # The hyprland package to use + package = pkgs.hyprland; + plugins = with pkgs.hyprlandPlugins; [ + hyprbars + hyprfocus + csgo-vulkan-fix + ]; + # Whether to enable XWayland + xwayland.enable = true; + settings = { + input = { + # xset rate 250 50 replacement on wayland... + # FAST MODE LET'S GOOO + repeat_rate = 50; + repeat_delay = 250; + }; + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + font_family = "monospace"; + }; + "$mod" = "SUPER"; + bind = + [ + "$mod, Q, killactive" + "$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel" + # firefox quickstart + "$mod, F, exec, ${pkgs.firefox}/bin/firefox" + # foot terminal + "$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' zsh" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 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; + }; + # ... } diff --git a/home-manager/stvnliu/hypr/hyprlock.nix b/home-manager/stvnliu/hypr/hyprlock.nix index 48df630..e93263b 100644 --- a/home-manager/stvnliu/hypr/hyprlock.nix +++ b/home-manager/stvnliu/hypr/hyprlock.nix @@ -1,39 +1,42 @@ -{pkgs, config, lib, ...}: { - programs.hyprlock = { - enable = true; - settings = { - general = { - disable_loading_bar = true; - grace = 10; - hide_cursor = true; - no_fade_in = false; - }; + pkgs, + config, + lib, + ... +}: { + programs.hyprlock = { + enable = true; + settings = { + general = { + disable_loading_bar = true; + grace = 10; + hide_cursor = true; + no_fade_in = false; + }; - background = [ - { - path = "screenshot"; - blur_passes = 3; - blur_size = 8; - } - ]; + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - outline_thickness = 5; - #placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\'; - shadow_passes = 2; - } - ]; - - }; - }; + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + #placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\'; + shadow_passes = 2; + } + ]; + }; + }; } diff --git a/home-manager/stvnliu/hypr/hyprpaper.nix b/home-manager/stvnliu/hypr/hyprpaper.nix index 244f4d5..b82c20f 100644 --- a/home-manager/stvnliu/hypr/hyprpaper.nix +++ b/home-manager/stvnliu/hypr/hyprpaper.nix @@ -1,12 +1,15 @@ -{pkgs, config, ...}: { - services.hyprpaper = { - enable = true; - settings = { - ipc = "on"; - splash = false; - preload = [ config.myWallPaperPathString ]; - wallpaper = [ ",${config.myWallPaperPathString}" ]; - }; - }; + pkgs, + config, + ... +}: { + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + preload = [config.myWallPaperPathString]; + wallpaper = [",${config.myWallPaperPathString}"]; + }; + }; } diff --git a/home-manager/stvnliu/swaywm.nix b/home-manager/stvnliu/swaywm.nix index d7f36e0..dfe7305 100644 --- a/home-manager/stvnliu/swaywm.nix +++ b/home-manager/stvnliu/swaywm.nix @@ -1,10 +1,13 @@ -{pkgs, lib, ...}: { - wayland.windowManager.sway = { - enable = true; - config = rec { - modifier = "Mod4"; - terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh"; - }; - }; + pkgs, + lib, + ... +}: { + wayland.windowManager.sway = { + enable = true; + config = rec { + modifier = "Mod4"; + terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh"; + }; + }; } diff --git a/home-manager/stvnliu/variables.nix b/home-manager/stvnliu/variables.nix index b0ddeab..21ba288 100644 --- a/home-manager/stvnliu/variables.nix +++ b/home-manager/stvnliu/variables.nix @@ -1,15 +1,20 @@ -{pkgs, config, lib, ...}: { - options = with lib; with types; { - myWallPaperPathString = mkOption { type = str; }; - myUserName = mkOption { type = str; }; - myDisplayName = mkOption { type = str; }; - myEmail = mkOption { type = str; }; - }; - config = rec { - myUserName = "stvnliu"; - myWallPaperPathString = "/home/${config.myUserName}/wallpaper.png"; - myDisplayName = "Zhongheng Liu"; - myEmail = "z.liu@outlook.com.gr"; - }; + pkgs, + config, + lib, + ... +}: { + options = with lib; + with types; { + myWallPaperPathString = mkOption {type = str;}; + myUserName = mkOption {type = str;}; + myDisplayName = mkOption {type = str;}; + myEmail = mkOption {type = str;}; + }; + config = rec { + myUserName = "stvnliu"; + myWallPaperPathString = "/home/${config.myUserName}/wallpaper.png"; + myDisplayName = "Zhongheng Liu"; + myEmail = "z.liu@outlook.com.gr"; + }; } diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 9e89589..3e1710a 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -15,7 +15,7 @@ ./services/laptop.preset.nix ./hardware-configuration.nix ]; - + boot.supportedFilesystems = ["ntfs"]; security.pam.services.hyprlock = {}; hardware.bluetooth = { enable = true; diff --git a/nixos/greetd-sway.nix b/nixos/greetd-sway.nix index 2177c38..ac6b04e 100644 --- a/nixos/greetd-sway.nix +++ b/nixos/greetd-sway.nix @@ -1,4 +1,9 @@ -{pkgs, config, lib, ...}: { +{ + pkgs, + config, + lib, + ... +}: { services.greetd = { enable = true; settings = { diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index b18ecf7..81b97e4 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -1,30 +1,34 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f9ff609f-6e72-43cf-917c-3bd3fde6c410"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f9ff609f-6e72-43cf-917c-3bd3fde6c410"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/2E4F-3060"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/2E4F-3060"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - swapDevices = [ ]; + swapDevices = []; # 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 diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix index aab5a94..7ccac2b 100644 --- a/nixos/nvidia.nix +++ b/nixos/nvidia.nix @@ -1,36 +1,36 @@ { - config, - lib, - ... + config, + lib, + ... }: { - specialisation = { - powersave.configuration = { - hardware.nvidia.prime = { - offload = { - enable = lib.mkForce true; - enableOffloadCmd = lib.mkForce true; - }; - sync.enable = lib.mkForce false; - }; - }; - }; - hardware.graphics.enable = true; - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { - prime = { - offload.enable = false; - sync = { - enable = true; - }; - amdgpuBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - forceFullCompositionPipeline = true; - modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; - # open = true; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.beta; - }; + specialisation = { + powersave.configuration = { + hardware.nvidia.prime = { + offload = { + enable = lib.mkForce true; + enableOffloadCmd = lib.mkForce true; + }; + sync.enable = lib.mkForce false; + }; + }; + }; + hardware.graphics.enable = true; + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia = { + prime = { + offload.enable = false; + sync = { + enable = true; + }; + amdgpuBusId = "PCI:5:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + forceFullCompositionPipeline = true; + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + # open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; } diff --git a/nixos/services/laptop.preset.nix b/nixos/services/laptop.preset.nix index 74a4b2d..f7365ed 100644 --- a/nixos/services/laptop.preset.nix +++ b/nixos/services/laptop.preset.nix @@ -1,8 +1,7 @@ -{...}: -{ - imports = [ - ./nginx.service.nix - ./pipewire.service.nix - ./syncthing.service.nix - ]; +{...}: { + imports = [ + ./nginx.service.nix + ./pipewire.service.nix + ./syncthing.service.nix + ]; } diff --git a/nixos/services/pipewire.service.nix b/nixos/services/pipewire.service.nix index 83af653..3781405 100644 --- a/nixos/services/pipewire.service.nix +++ b/nixos/services/pipewire.service.nix @@ -1,21 +1,21 @@ {pkgs, ...}: { - services.pipewire = { - enable = true; - alsa = { - enable = true; - support32Bit = true; - }; - pulse.enable = true; - jack.enable = true; - wireplumber.configPackages = [ - (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' - bluez_monitor.properties = { - ["bluez5.enable-sbc-xq"] = true, - ["bluez5.enable-msbc"] = true, - ["bluez5.enable-hw-volume"] = true, - ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" - } - '') - ]; - }; + services.pipewire = { + enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + pulse.enable = true; + jack.enable = true; + wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + '') + ]; + }; } diff --git a/nixos/services/syncthing.service.nix b/nixos/services/syncthing.service.nix index b1b34af..54c2ff4 100644 --- a/nixos/services/syncthing.service.nix +++ b/nixos/services/syncthing.service.nix @@ -1,17 +1,17 @@ { - pkgs, - config, - lib, - ... + pkgs, + config, + lib, + ... }: { - services = { - syncthing = { - enable = true; - user = "${config.myUserName}"; - dataDir = "/home/${config.myUserName}/Documents"; - configDir = "/home/${config.myUserName}/Documents/.config/syncthing"; - }; - }; - networking.firewall.allowedTCPPorts = [8384 22000]; - networking.firewall.allowedUDPPorts = [22000 21027]; + services = { + syncthing = { + enable = true; + user = "${config.myUserName}"; + dataDir = "/home/${config.myUserName}/Documents"; + configDir = "/home/${config.myUserName}/Documents/.config/syncthing"; + }; + }; + networking.firewall.allowedTCPPorts = [8384 22000]; + networking.firewall.allowedUDPPorts = [22000 21027]; } diff --git a/nixos/variables.nix b/nixos/variables.nix index e6b111d..fdf47b4 100644 --- a/nixos/variables.nix +++ b/nixos/variables.nix @@ -1,15 +1,19 @@ -{config, pkgs, lib, ...}: { - - # Type definitions for nix variables used in this configuration - options = with lib; with types; { - myUserName = mkOption { type = str; }; - myHostName = mkOption { type = str; }; - }; - - # Default values for this configuration - config = { - myUserName = "stvnliu"; - myHostName = "homelab-nix"; - }; + config, + pkgs, + lib, + ... +}: { + # Type definitions for nix variables used in this configuration + options = with lib; + with types; { + myUserName = mkOption {type = str;}; + myHostName = mkOption {type = str;}; + }; + + # Default values for this configuration + config = { + myUserName = "stvnliu"; + myHostName = "homelab-nix"; + }; } |