From c8bca81c12a9195e164f17c8edc4837ac28cf4fe Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Sat, 21 Jan 2023 19:03:24 +0100 Subject: [PATCH] configured lockscreen --- hosts/thinkpad/default.nix | 4 +-- shared/input.nix | 20 -------------- shared/zsh-fix.nix | 6 ----- users/rouven/default.nix | 1 + users/rouven/fixes.nix | 24 +++++++++++++++++ users/rouven/modules/hyprland/default.nix | 30 +++++++++++++++------ users/rouven/modules/hyprland/hyprland.conf | 29 ++++++++++++++------ 7 files changed, 69 insertions(+), 45 deletions(-) delete mode 100644 shared/input.nix delete mode 100644 shared/zsh-fix.nix create mode 100644 users/rouven/fixes.nix diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 8626683..ccd992a 100755 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -1,5 +1,4 @@ { config, pkgs, lib, ... }: - { nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -10,7 +9,6 @@ ../../shared/vim.nix ../../shared/sops.nix ../../shared/gpg.nix - ../../shared/zsh-fix.nix ]; # Use the systemd-boot EFI boot loader. @@ -61,6 +59,7 @@ virtualisation.libvirtd.enable = true; virtualisation.spiceUSBRedirection.enable = true; + # fix to enable secure boot in vms environment.etc = { "ovmf/edk2-x86_64-secure-code.fd" = { @@ -74,7 +73,6 @@ }; }; - environment.systemPackages = with pkgs; [ wget gcc diff --git a/shared/input.nix b/shared/input.nix deleted file mode 100644 index 87be135..0000000 --- a/shared/input.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - xorg.xmodmap - ]; - # Configure keymap in X11 - services.xserver.layout = "us"; - services.xserver.xkbVariant = "dvorak-alt-intl"; - - # Port this to wayland TODO. doesn't even work with gdm lmao - #services.xserver.displayManager.setupCommands = - #"${pkgs.xorg.xmodmap}/bin/xmodmap ${pkgs.writeText "xkb-layout" '' - #keycode 108 = Mode_switch - #keycode 94 = Shift_L NoSymbol Shift_L - #keysym a = a A adiaeresis Adiaeresis - #keysym o = o O odiaeresis Odiaeresis - #keysym u = u U udiaeresis Udiaeresis - #keysym s = s S ssharp - #''}"; -} diff --git a/shared/zsh-fix.nix b/shared/zsh-fix.nix deleted file mode 100644 index 85d3307..0000000 --- a/shared/zsh-fix.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, ... }: -{ - # This is a fix for zsh in the home manager - # If you only enable it in home manager, some important files for completion are missing - programs.zsh.enable = true; -} diff --git a/users/rouven/default.nix b/users/rouven/default.nix index 290b391..e276dfa 100644 --- a/users/rouven/default.nix +++ b/users/rouven/default.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: { + imports = [ ./fixes.nix ]; nixpkgs.config.allowUnfree = true; users.users.rouven = { isNormalUser = true; diff --git a/users/rouven/fixes.nix b/users/rouven/fixes.nix new file mode 100644 index 0000000..aa5b56f --- /dev/null +++ b/users/rouven/fixes.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: +{ + # generate system completions + programs.zsh.enable = true; + + # fixes pam entries for swaylock + security.pam.services.swaylock.text = '' + # Account management. + account required pam_unix.so + + # Authentication management. + + auth sufficient pam_unix.so nullok likeauth try_first_pass + auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so + auth required pam_deny.so + + # Password management. + password sufficient pam_unix.so nullok sha512 + + # Session management. + session required pam_env.so conffile=/etc/pam/environment readenv=0 + session required pam_unix.so + ''; +} diff --git a/users/rouven/modules/hyprland/default.nix b/users/rouven/modules/hyprland/default.nix index 481b2a9..6aef79f 100644 --- a/users/rouven/modules/hyprland/default.nix +++ b/users/rouven/modules/hyprland/default.nix @@ -2,20 +2,35 @@ { imports = [ ./waybar.nix ]; wayland.windowManager.hyprland.enable = true; - xdg.configFile."hypr/hyprland.conf".source = ./hyprland.conf; - xdg.configFile."hypr/hyprpaper.conf".text = '' - preload = ${../../../../images/wallpaper.png} - wallpaper =eDP-1, ${../../../../images/wallpaper.png} - wallpaper =HDMI-A-1, ${../../../../images/wallpaper.png} - ''; + xdg.configFile = { + "hypr/hyprland.conf".source = ./hyprland.conf; + "hypr/hyprpaper.conf".text = '' + preload = ${../../../../images/wallpaper.png} + wallpaper =eDP-1, ${../../../../images/wallpaper.png} + wallpaper =HDMI-A-1, ${../../../../images/wallpaper.png} + ''; + "swaylock/config".text = '' + indicator-radius=200 + indicator-thickness=3 + inside-color=00000000 + inside-ver-color=${config.colorScheme.colors.base0D} + inside-clear-color=${config.colorScheme.colors.base0B} + ring-color=${config.colorScheme.colors.base03} + ring-wrong-color=${config.colorScheme.colors.base08} + screenshot + effect-blur=7x5 + ''; + }; + home.packages = with pkgs; [ + pulseaudio # installed to have pactl wofi wl-clipboard grim slurp font-awesome hyprpaper.packages.x86_64-linux.default - #xdph.packages.x86_64-linux.default + swaylock-effects ]; xdg.configFile."wofi/config".text = '' @@ -60,7 +75,6 @@ ''; - programs.mako = { enable = true; backgroundColor = "#${config.colorScheme.colors.base02}FF"; diff --git a/users/rouven/modules/hyprland/hyprland.conf b/users/rouven/modules/hyprland/hyprland.conf index 37fc197..747905c 100644 --- a/users/rouven/modules/hyprland/hyprland.conf +++ b/users/rouven/modules/hyprland/hyprland.conf @@ -80,7 +80,7 @@ master { gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = on + workspace_swipe = off # doesn't really work } # Example windowrule v1 @@ -95,12 +95,12 @@ $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Return, exec, alacritty -bind = $mainMod SHIFT, Q, killactive, -bind = $mainMod, M, exit, -bind = $mainMod, F, togglefloating, +bind = $mainMod SHIFT, Q, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, F, togglefloating, bind = ALT, Space, exec, wofi --show drun bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, S, togglesplit, # dwindle +bind = $mainMod, S, togglesplit, # dwindlr # Move focus with mainMod + arrow keys bind = $mainMod, H, movefocus, l @@ -132,7 +132,7 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 -# Scroll through existing workspaces with mainMod + scroll +# Scroll through existing workspaces wiswaylockth mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 @@ -140,5 +140,18 @@ bind = $mainMod, mouse_up, workspace, e-1 bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow -# Screenshot -bind = ,Print,exec, grim -g "$(slurp)" - | wl-copy -t image/png +# All the fancy XF86 Keys +bind = ,Print, exec, grim -g "$(slurp)" - | wl-copy -t image/png +bind = ,XF86MonBrightnessUp, exec, light -A 10 +bind = ,XF86MonBrightnessDown, exec, light -U 10 +bind = ,XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle +bind = ,XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle +bind = ,XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% +bind = ,XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% + +# even more fancy stuff (aka abusing XF86 keys) +bind = ,XF86WLAN, exec, wpa_gui +bind = ,XF86Messenger, exec, makoctl dismiss +bind = SHIFT ,XF86Messenger, exec, makoctl restore +bind = ,XF86Go, exec, makoctl invoke +bind = ,Cancel, exec, swaylock