From 0aa0c04c6ef40e50e240db9ac6efa5320e8d1d58 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Fri, 8 Dec 2023 22:17:49 +0100 Subject: [PATCH 1/8] wastema time --- users/kopatz.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"; }; }; From 53e1d3b1439550d6684c086ac8002f4bae7d2114 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 10:46:28 +0100 Subject: [PATCH 2/8] add gamescope to steam and gamemode --- flake.nix | 1 + modules/graphical/gamemode.nix | 11 +++++++++++ modules/graphical/shared.nix | 1 + modules/hardware/nvidia.nix | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 modules/graphical/gamemode.nix 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/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/shared.nix b/modules/graphical/shared.nix index 17e2375..4c0532b 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; 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; }; } From 1505badeeb787f4c95cc98525d244e919ce18057 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 15:51:05 +0100 Subject: [PATCH 3/8] money printer --- modules/graphical/hyprland.nix | 35 +++++++++++++++++++++++++++++++++- systems/pc/configuration.nix | 4 ++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 1bc860b..e39cc50 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -176,9 +176,11 @@ 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"; in [ "$mainMod, Q, exec, ${konsole}" "$mainMod, C, killactive" @@ -186,10 +188,12 @@ in "$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" + + #"$mainMod, G, exec, ${wl-paste} | grep -C 10 -f - ~/Nextcloud/old_gdrive/fh/risikomanagement/crisam.txt | sed 's/^[ \\t]*//' | sed 's/[ \\t]*$//' | ${wl-copy}" "$mainMod, P, pseudo" # dwindle "$mainMod, J, togglesplit" # dwindle # Move focus with mainMod + arrow keys @@ -263,6 +267,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/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; From ab2c60262244d98903c3cad46c005859c7c9184b Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:55:20 +0100 Subject: [PATCH 4/8] small laptop changes --- laptop/configuration.nix | 6 +++--- modules/cli-tools.nix | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) 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 ]; } From a1a1af1012e99defc226a8bdabcf1a5f6224fc34 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 17:02:17 +0100 Subject: [PATCH 5/8] add way to adjust brightness --- modules/graphical/hyprland.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index e39cc50..d66f664 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -181,6 +181,7 @@ in slurp = "${pkgs.slurp}/bin/slurp"; swww = "${pkgs.swww}/bin/swww"; pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; + brightnessctl = "${brightnessctl}/bin/brightnessctl"; in [ "$mainMod, Q, exec, ${konsole}" "$mainMod, C, killactive" @@ -192,8 +193,8 @@ in "$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" - - #"$mainMod, G, exec, ${wl-paste} | grep -C 10 -f - ~/Nextcloud/old_gdrive/fh/risikomanagement/crisam.txt | sed 's/^[ \\t]*//' | sed 's/[ \\t]*$//' | ${wl-copy}" + " , XF86MonBrightnessUp, exec, ${brightnessctl} -s +5%" + " , XF86MonBrightnessDown, exec, ${brightnessctl} -s 5%-" "$mainMod, P, pseudo" # dwindle "$mainMod, J, togglesplit" # dwindle # Move focus with mainMod + arrow keys From d99feba723cc6a99b199b59997ef9f59abe39dd1 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 17:13:11 +0100 Subject: [PATCH 6/8] fix brightness ctl --- modules/graphical/hyprland.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index d66f664..08f062c 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -181,7 +181,7 @@ in slurp = "${pkgs.slurp}/bin/slurp"; swww = "${pkgs.swww}/bin/swww"; pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; - brightnessctl = "${brightnessctl}/bin/brightnessctl"; + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; in [ "$mainMod, Q, exec, ${konsole}" "$mainMod, C, killactive" @@ -193,8 +193,8 @@ in "$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%-" + " , XF86MonBrightnessUp, exec, ${brightnessctl} s +5%" + " , XF86MonBrightnessDown, exec, ${brightnessctl} s 5%-" "$mainMod, P, pseudo" # dwindle "$mainMod, J, togglesplit" # dwindle # Move focus with mainMod + arrow keys From c87a80dce21b773aede8f11ae45e3b0ac72d696a Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 17:15:33 +0100 Subject: [PATCH 7/8] add brightnessctl to shared file --- modules/graphical/shared.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/graphical/shared.nix b/modules/graphical/shared.nix index 4c0532b..31d1896 100644 --- a/modules/graphical/shared.nix +++ b/modules/graphical/shared.nix @@ -60,6 +60,7 @@ in mpv p7zip qbittorrent + brightnessctl (wrapOBS { plugins = with obs-studio-plugins; [ obs-pipewire-audio-capture From e729f8c8153ef3e54dd91c2a6ecd1770a8ee0e42 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 9 Dec 2023 17:49:22 +0100 Subject: [PATCH 8/8] add swaylock --- modules/graphical/hyprland.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 08f062c..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; @@ -182,9 +192,11 @@ in 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"