From c0597a357a5bd87817f592100908e190b72fa1e0 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Mon, 12 Aug 2024 09:04:16 -0400 Subject: [PATCH] Revert "desktop: swaylock -> gtklock (#89)" This reverts commit 62f2d5b1d067436e6b43b4460c3e74802ae4da2d. --- homeManagerModules/apps/default.nix | 1 - homeManagerModules/apps/gtklock/default.nix | 43 ------------------- .../desktop/hyprland/settings.nix | 2 +- homeManagerModules/desktop/sway/settings.nix | 2 +- .../desktop/wayland/default.nix | 2 +- homeManagerModules/options.nix | 1 - .../services/swayidle/default.nix | 6 +-- nixosModules/desktop/waylandComp.nix | 43 ++++++++++--------- 8 files changed, 28 insertions(+), 72 deletions(-) delete mode 100644 homeManagerModules/apps/gtklock/default.nix diff --git a/homeManagerModules/apps/default.nix b/homeManagerModules/apps/default.nix index 4bc4327c..afeaf7d0 100644 --- a/homeManagerModules/apps/default.nix +++ b/homeManagerModules/apps/default.nix @@ -7,7 +7,6 @@ ./fastfetch ./firefox ./fuzzel - ./gtklock ./helix ./keepassxc ./kitty diff --git a/homeManagerModules/apps/gtklock/default.nix b/homeManagerModules/apps/gtklock/default.nix deleted file mode 100644 index 41a8073f..00000000 --- a/homeManagerModules/apps/gtklock/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.ar.home; -in { - config = lib.mkIf cfg.apps.gtklock.enable { - home.packages = with pkgs; [ - gtklock - ]; - - xdg.configFile = { - "gtklock/config.ini".text = '' - [main] - gtk-theme=adw-gtk3-dark - time-format=%I:%M%p - ''; - - "gtklock/style.css".text = '' - window { - background-image: url("${cfg.theme.wallpaper}"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - background-color: black; - } - - #clock-label { - margin-bottom: 50px; - font-size: 700%; - font-weight: bold; - color: ${cfg.theme.colors.text}; - } - - #input-label { - color: ${cfg.theme.colors.text}; - } - ''; - }; - }; -} diff --git a/homeManagerModules/desktop/hyprland/settings.nix b/homeManagerModules/desktop/hyprland/settings.nix index e54ffdd4..48648377 100644 --- a/homeManagerModules/desktop/hyprland/settings.nix +++ b/homeManagerModules/desktop/hyprland/settings.nix @@ -27,7 +27,7 @@ in { bind = [ - "$mod CTRL,L,exec,${lib.getExe pkgs.gtklock}" + "$mod CTRL,L,exec,${lib.getExe pkgs.swaylock}" "$mod SHIFT,G,togglegroup" "$mod SHIFT,R,exec,${lib.getExe config.programs.rofi.package} -show run" "$mod SHIFT,S,movetoworkspace,special:magic" diff --git a/homeManagerModules/desktop/sway/settings.nix b/homeManagerModules/desktop/sway/settings.nix index 9d82b0e1..d3ee31a3 100644 --- a/homeManagerModules/desktop/sway/settings.nix +++ b/homeManagerModules/desktop/sway/settings.nix @@ -95,7 +95,7 @@ in { "${modifier}+B" = "exec ${lib.getExe cfg.defaultApps.webBrowser}"; "${modifier}+C" = "kill"; "${modifier}+Comma" = "workspace prev"; - "${modifier}+Control+L" = "exec ${lib.getExe pkgs.gtklock}"; + "${modifier}+Control+L" = "exec ${lib.getExe pkgs.swaylock}"; "${modifier}+E" = "exec ${lib.getExe cfg.defaultApps.editor}"; "${modifier}+F" = "exec ${lib.getExe cfg.defaultApps.fileManager}"; "${modifier}+F11" = "exec pkill -SIGUSR1 waybar"; # Show/hide waybar diff --git a/homeManagerModules/desktop/wayland/default.nix b/homeManagerModules/desktop/wayland/default.nix index 9ab19a35..4d5c6473 100644 --- a/homeManagerModules/desktop/wayland/default.nix +++ b/homeManagerModules/desktop/wayland/default.nix @@ -9,7 +9,7 @@ apps = { kitty.enable = lib.mkDefault true; rofi.enable = lib.mkDefault true; - gtklock.enable = lib.mkDefault true; + swaylock.enable = lib.mkDefault true; }; services = { diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index 00ffd112..3d171357 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -36,7 +36,6 @@ in { fastfetch.enable = lib.mkEnableOption "Fastfetch."; firefox.enable = lib.mkEnableOption "Firefox web browser."; fuzzel.enable = lib.mkEnableOption "Fuzzel app launcher."; - gtklock.enable = lib.mkEnableOption "GTK lockscreen based on gtkgreet."; helix.enable = lib.mkEnableOption "Helix text editor."; keepassxc = { diff --git a/homeManagerModules/services/swayidle/default.nix b/homeManagerModules/services/swayidle/default.nix index fe21bcef..45afc13e 100644 --- a/homeManagerModules/services/swayidle/default.nix +++ b/homeManagerModules/services/swayidle/default.nix @@ -19,11 +19,11 @@ in { } { event = "before-sleep"; - command = "${lib.getExe pkgs.gtklock} && ${lib.getExe' pkgs.coreutils "sleep"} 2"; + command = "${lib.getExe pkgs.swaylock} && ${lib.getExe' pkgs.coreutils "sleep"} 2"; } { event = "lock"; - command = "${lib.getExe pkgs.gtklock}"; + command = "${lib.getExe pkgs.swaylock}"; } ]; @@ -42,7 +42,7 @@ in { ++ lib.optional (!cfg.desktop.autoSuspend) { timeout = 600; - command = "${lib.getExe pkgs.gtklock}"; + command = "${lib.getExe pkgs.swaylock}"; } ++ lib.optional (!cfg.desktop.autoSuspend && cfg.desktop.hyprland.enable) { diff --git a/nixosModules/desktop/waylandComp.nix b/nixosModules/desktop/waylandComp.nix index a39e9110..a3f329d9 100644 --- a/nixosModules/desktop/waylandComp.nix +++ b/nixosModules/desktop/waylandComp.nix @@ -5,7 +5,9 @@ ... }: { config = lib.mkIf (config.ar.desktop.hyprland.enable || config.ar.desktop.sway.enable) { - programs.gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3; + programs = { + gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3; + }; services = { dbus.packages = [pkgs.gcr]; @@ -13,30 +15,29 @@ udev.packages = [pkgs.swayosd]; }; - security.pam.services = let - text = '' - # Account management. - account required pam_unix.so # unix (order 10900) + security.pam.services = { + swaylock = { + text = '' + # Account management. + account required pam_unix.so # unix (order 10900) - # Authentication management. - auth sufficient pam_unix.so likeauth try_first_pass nullok # unix (order 11500) - ${ - lib.strings.optionalString config.services.fprintd.enable - "auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so # fprintd (order 11300)" - } + # Authentication management. + auth sufficient pam_unix.so likeauth try_first_pass likeauth nullok # unix (order 11500) + ${ + lib.strings.optionalString config.services.fprintd.enable + "auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so # fprintd (order 11300)" + } - auth required pam_deny.so # deny (order 12300) + auth required pam_deny.so # deny (order 12300) - # Password management. - password sufficient pam_unix.so nullok yescrypt # unix (order 10200) + # Password management. + password sufficient pam_unix.so nullok yescrypt # unix (order 10200) - # Session management. - session required pam_env.so conffile=/etc/pam/environment readenv=0 # env (order 10100) - session required pam_unix.so # unix (order 10200) - ''; - in { - gtklock = {inherit text;}; - swaylock = {inherit text;}; + # Session management. + session required pam_env.so conffile=/etc/pam/environment readenv=0 # env (order 10100) + session required pam_unix.so # unix (order 10200) + ''; + }; }; }; }