From fc2877381f1d8ff933da0b5bcc62e878a741544a Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 27 Apr 2024 21:21:26 -0400 Subject: [PATCH] home: added new swaylock module with riced configuration file --- homeManagerModules/apps/default.nix | 1 + homeManagerModules/apps/swaylock/default.nix | 56 ++++++++++++++++++++ homeManagerModules/desktop/hypr/default.nix | 3 +- homeManagerModules/desktop/sway/default.nix | 13 ++--- 4 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 homeManagerModules/apps/swaylock/default.nix diff --git a/homeManagerModules/apps/default.nix b/homeManagerModules/apps/default.nix index 11a7c2c0..5b28993e 100644 --- a/homeManagerModules/apps/default.nix +++ b/homeManagerModules/apps/default.nix @@ -18,6 +18,7 @@ ./mako ./neofetch ./neovim + ./swaylock ./tauon ./thunar ./thunderbird diff --git a/homeManagerModules/apps/swaylock/default.nix b/homeManagerModules/apps/swaylock/default.nix new file mode 100644 index 00000000..2519caab --- /dev/null +++ b/homeManagerModules/apps/swaylock/default.nix @@ -0,0 +1,56 @@ +{ + pkgs, + lib, + config, + ... +}: { + options = {alyraffauf.apps.swaylock.enable = lib.mkEnableOption "Enable Swaylock.";}; + + config = lib.mkIf config.alyraffauf.apps.swaylock.enable { + home.packages = with pkgs; [swaylock]; + + xdg.configFile."swaylock/config".text = '' + ignore-empty-password + font="Noto SansM Nerd Font Regular" + + color=303446 + image=${config.xdg.dataHome}/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg + + indicator-radius=120 + indicator-thickness=20 + indicator-caps-lock + indicator-idle-visible + + key-hl-color=a6d189 + + separator-color=232634cc + + inside-color=303446cc + inside-clear-color=303446cc + inside-caps-lock-color=303446cc + inside-ver-color=303446cc + inside-wrong-color=303446cc + + ring-color=ca9ee6cc + ring-clear-color=85c1dccc + ring-caps-lock-color=e78284cc + ring-ver-color=a6d189cc + ring-wrong-color=e78284cc + + line-color=232634cc + line-clear-color=232634cc + line-caps-lock-color=232634cc + line-ver-color=232634cc + line-wrong-color=232634cc + + text-clear-color=c6d0f5 + text-ver-color=c6d0f5 + text-wrong-color=c6d0f5 + + bs-hl-color=e78284 + caps-lock-key-hl-color=e78284 + caps-lock-bs-hl-color=e78284 + text-caps-lock-color=c6d0f5 + ''; + }; +} diff --git a/homeManagerModules/desktop/hypr/default.nix b/homeManagerModules/desktop/hypr/default.nix index 65f45710..451800d9 100644 --- a/homeManagerModules/desktop/hypr/default.nix +++ b/homeManagerModules/desktop/hypr/default.nix @@ -36,6 +36,7 @@ firefox.enable = lib.mkDefault true; fuzzel.enable = lib.mkDefault true; mako.enable = lib.mkDefault true; + swaylock.enable = lib.mkDefault true; thunar.enable = lib.mkDefault true; waybar.enable = lib.mkDefault true; wlogout.enable = lib.mkDefault true; @@ -94,7 +95,7 @@ # lock = pkgs.hyprlock + "/bin/hyprlock --immediate"; # idled = pkgs.hypridle + "/bin/hypridle"; - lock = pkgs.swaylock + ''/bin/swaylock -l -f -c 303446 --indicator-idle-visible --font "Noto SansM Nerd Font Regular" --ring-color ca9ee6 --key-hl-color a6d189 --ring-ver-color a6d189 --ring-wrong-color e78284 --inside-color 303446''; + lock = pkgs.swaylock + ''/bin/swaylock''; idled = if config.alyraffauf.desktop.hyprland.autoSuspend then '' diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index 91593546..295d470a 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -18,14 +18,15 @@ config = lib.mkIf config.alyraffauf.desktop.sway.enable { alyraffauf = { apps = { - waybar.enable = lib.mkDefault true; - mako.enable = lib.mkDefault true; - fuzzel.enable = lib.mkDefault true; - wlogout.enable = lib.mkDefault true; alacritty.enable = lib.mkDefault true; firefox.enable = lib.mkDefault true; + fuzzel.enable = lib.mkDefault true; kanshi.enable = lib.mkDefault true; + mako.enable = lib.mkDefault true; + swaylock.enable = lib.mkDefault true; thunar.enable = lib.mkDefault true; + waybar.enable = lib.mkDefault true; + wlogout.enable = lib.mkDefault true; }; desktop.theme.enable = lib.mkDefault true; }; @@ -75,9 +76,9 @@ bar = pkgs.waybar + "/bin/waybar -s ${config.xdg.configHome}/waybar/sway-style.css"; launcher = pkgs.fuzzel + "/bin/fuzzel"; notifyd = pkgs.mako + "/bin/mako"; - wallpaperd = pkgs.swaybg + "/bin/swaybg -i ~/.local/share/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg"; + wallpaperd = pkgs.swaybg + "/bin/swaybg -i ${config.xdg.dataHome}/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg"; logout = pkgs.wlogout + "/bin/wlogout"; - lock = pkgs.swaylock + ''/bin/swaylock -l -f -c 303446 --indicator-idle-visible --font "Noto SansM Nerd Font Regular" --ring-color ca9ee6 --key-hl-color a6d189 --ring-ver-color a6d189 --ring-wrong-color e78284 --inside-color 303446''; + lock = pkgs.swaylock + ''/bin/swaylock''; idled = if config.alyraffauf.desktop.sway.autoSuspend then ''