diff --git a/flake.nix b/flake.nix index 978defe..b5ae866 100644 --- a/flake.nix +++ b/flake.nix @@ -102,6 +102,7 @@ ./modules/graphical/plasma.nix ./modules/graphical/hyprland.nix ./modules/graphical/emulators.nix + ./modules/graphical/gamemode.nix ./modules/graphical/shared.nix ./modules/hardware/nvidia.nix ./modules/hardware/ssd.nix diff --git a/laptop/configuration.nix b/laptop/configuration.nix index 057504b..0843dce 100644 --- a/laptop/configuration.nix +++ b/laptop/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { @@ -9,8 +9,8 @@ ]; services.xserver = { - layout = "at"; - xkbVariant = ""; + layout = lib.mkForce "at"; + xkbVariant = lib.mkForce ""; enable = true; displayManager.gdm.enable = true; }; diff --git a/modules/cli-tools.nix b/modules/cli-tools.nix index fdd1063..45ee46b 100644 --- a/modules/cli-tools.nix +++ b/modules/cli-tools.nix @@ -16,5 +16,6 @@ vulkan-tools ffmpeg nethogs + dig ]; } diff --git a/modules/graphical/gamemode.nix b/modules/graphical/gamemode.nix new file mode 100644 index 0000000..a9fc680 --- /dev/null +++ b/modules/graphical/gamemode.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +{ + programs.gamemode = { + enable = true; + settings.custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; + }; + }; +} diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 1bc860b..5d60dc1 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -45,9 +45,19 @@ in enable = true; }; + security.pam.services = { + swaylock = { + fprintAuth = false; + text = '' + auth include login + ''; + }; + }; + home-manager.users.kopatz = { #systemd.user.services.waybar.Service.ExecStart = lib.mkForce "${pkgs.waybar}/bin/waybar -b 0"; + programs.swaylock.enable = true; wayland.windowManager.hyprland = { enable = true; enableNvidiaPatches = true; @@ -176,20 +186,27 @@ in konsole = "${pkgs.konsole}/bin/konsole"; thunar = "${pkgs.xfce.thunar}/bin/thunar"; wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; + wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste"; grim = "${pkgs.grim}/bin/grim"; slurp = "${pkgs.slurp}/bin/slurp"; swww = "${pkgs.swww}/bin/swww"; + pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; + swaylock = "${pkgs.swaylock}/bin/swaylock"; in [ "$mainMod, Q, exec, ${konsole}" "$mainMod, C, killactive" + "$mainMod, L, exec, ${swaylock} -f -c 000000" "$mainMod, M, exit," "$mainMod, E, exec, ${thunar}" "$mainMod, V, togglefloating" "$mainMod, I, exec, ${rofi} -show drun -show-icons" - "$mainMod, S, exec, cat ~/songs | shuf -n 1 | sed \"s/^/b\.p /g\" | ${wl-copy}" + "$mainMod, S, exec, cat ~/songs | shuf -n 0 | sed \"s/^/b\.p /g\" | ${wl-copy}" "$mainMod, R, exec, ${swww} img $(ls -d ~/Nextcloud/dinge/Bg/* | shuf -n 1)" " , Print, exec, ${grim} -g \"$(${slurp} -d)\" - | ${wl-copy}" "ALT, SPACE, exec, ${rofi} -show combi" + " , XF86MonBrightnessUp, exec, ${brightnessctl} s +5%" + " , XF86MonBrightnessDown, exec, ${brightnessctl} s 5%-" "$mainMod, P, pseudo" # dwindle "$mainMod, J, togglesplit" # dwindle # Move focus with mainMod + arrow keys @@ -263,6 +280,35 @@ in "${pkgs.dunst}/bin/dunst &" ]; }; + extraConfig = let + wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; + wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste"; + in '' + bind = $mainMod, A, submap, notes + + submap = notes + # below + bind = $mainMod, B, exec, ${wl-paste} | grep -B 15 -i -f - ~/Nextcloud/old_gdrive/fh/risikomanagement/crisam.txt | sed 's/[ \t]*$//' | ${wl-copy} + # above + bind = $mainMod, A, exec, ${wl-paste} | grep -A 15 -i -f - ~/Nextcloud/old_gdrive/fh/risikomanagement/crisam.txt | sed 's/[ \t]*$//' | ${wl-copy} + # context + bind = $mainMod, C, exec, ${wl-paste} | grep -C 15 -i -f - ~/Nextcloud/old_gdrive/fh/risikomanagement/crisam.txt | sed 's/[ \t]*$//' | ${wl-copy} + # trim + bind = $mainMod, T, exec, ${wl-paste} | sed 's/[ \t]*$//' | sed 's/^[ \t]*//' | ${wl-copy} + # notes + bind = $mainMod, 1, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/1.txt | ${wl-copy} + bind = $mainMod, 2, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/2.txt | ${wl-copy} + bind = $mainMod, 3, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/3.txt | ${wl-copy} + bind = $mainMod, 4, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/4.txt | ${wl-copy} + bind = $mainMod, 5, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/5.txt | ${wl-copy} + bind = $mainMod, 6, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/6.txt | ${wl-copy} + bind = $mainMod, 7, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/7.txt | ${wl-copy} + bind = $mainMod, 8, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/8.txt | ${wl-copy} + bind = $mainMod, 0, exec, cat ~/Nextcloud/old_gdrive/fh/risikomanagement/0.txt | ${wl-copy} + + bind = , escape, submap, reset + submap = reset + ''; }; programs.waybar = { enable = true; diff --git a/modules/graphical/shared.nix b/modules/graphical/shared.nix index 17e2375..31d1896 100644 --- a/modules/graphical/shared.nix +++ b/modules/graphical/shared.nix @@ -10,6 +10,7 @@ in enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + gamescopeSession.enable = true; }; programs.kdeconnect.enable = true; @@ -59,6 +60,7 @@ in mpv p7zip qbittorrent + brightnessctl (wrapOBS { plugins = with obs-studio-plugins; [ obs-pipewire-audio-capture diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix index e09bd32..1017c4e 100644 --- a/modules/hardware/nvidia.nix +++ b/modules/hardware/nvidia.nix @@ -28,6 +28,6 @@ # accessible via `nvidia-settings`. nvidiaSettings = true; # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.production; + package = config.boot.kernelPackages.nvidiaPackages.beta; }; } diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index e598c40..f89929b 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -81,8 +81,8 @@ # services.xserver.libinput.enable = true; # Enable automatic login for the user. - services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = "kopatz"; + #services.xserver.displayManager.autoLogin.enable = true; + #services.xserver.displayManager.autoLogin.user = "kopatz"; # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/users/kopatz.nix b/users/kopatz.nix index bb67028..e7cf1f9 100644 --- a/users/kopatz.nix +++ b/users/kopatz.nix @@ -51,6 +51,19 @@ in enableZshIntegration = true; nix-direnv.enable = true; }; + programs.lf = { + enable = true; + previewer.source = pkgs.writeShellScript "pv.sh" '' + #!/bin/sh + case "$(${pkgs.file}/bin/file -Lb --mime-type -- "$1")" in + #image/*|video/*) ${pkgs.chafa}/bin/chafa -f sixel -s "$2x$3" --animate false $1;; + application/x-tar) tar tf "$1";; + application/vnd.rar) ${pkgs.p7zip}/bin/7z l "$1";; + application/x-7z-compressed) ${pkgs.p7zip}/bin/7z l "$1";; + *) ${pkgs.ctpv}/bin/ctpv "$1";; + esac + ''; + }; home.stateVersion = "23.05"; }; };