diff --git a/home/desktop/hyprland/default.nix b/home/desktop/hyprland/default.nix index 21eb2f9..0c377f0 100644 --- a/home/desktop/hyprland/default.nix +++ b/home/desktop/hyprland/default.nix @@ -6,10 +6,17 @@ }: let modifier = config.windowManager.modifierKey; menu = config.programs.menu.dmenuCommand; + lock_cmd = "${config.programs.hyprlock.package}/bin/hyprlock"; + color = { + inherit (config.lib.stylix.colors) yellow red; + bg = config.lib.stylix.colors.base00; + fg = config.lib.stylix.colors.base07; + text = config.lib.stylix.colors.base05; + }; + rgb = color: "rgb(${color})"; + in { imports = [ - (import ../utils/swaylock.nix) - (import ../utils/swayidle.nix) (import ../utils/waybar.nix) (import ../utils/display.nix) ]; @@ -19,6 +26,64 @@ in { extraPortals = [pkgs.xdg-desktop-portal-gtk]; }; + services.hypridle = { + enable = true; + settings = { + general = { + before_sleep_cmd = "rbw lock"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "pidof ${lock_cmd} || ${lock_cmd}"; + }; + + listener = [ + { + timeout = 300; + on-timeout = "loginctl lock-session"; + } + { + timeout = 1200; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + + programs.hyprlock = { + enable = true; + settings = { + # https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/ + general = { + disable_loading_bar = true; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + dots_center = true; + fade_on_empty = true; + outline_thickness = 5; + shadow_passes = 2; + inner_color = rgb color.bg; + outer_color = rgb color.fg; + font_color = rgb color.text; + fail_color = rgb color.red; + check_color = rgb color.yellow; + } + ]; + }; + }; + wayland.windowManager.hyprland = { enable = true; systemd = { @@ -26,7 +91,6 @@ in { variables = ["--all"]; }; settings = { - exec-once = ["${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image} -m fill"]; input = { touchpad = { natural_scroll = true; diff --git a/home/desktop/utils/swayidle.nix b/home/desktop/utils/swayidle.nix index ee99499..f9d2bd4 100644 --- a/home/desktop/utils/swayidle.nix +++ b/home/desktop/utils/swayidle.nix @@ -15,7 +15,7 @@ timeouts = [ { timeout = 300; - command = "${pkgs.swaylock-effects}/bin/swaylock -f"; + command = "loginctl lock-session"; } { timeout = 600; diff --git a/home/programs/graphical.nix b/home/programs/graphical.nix index a10397a..342376f 100644 --- a/home/programs/graphical.nix +++ b/home/programs/graphical.nix @@ -33,6 +33,7 @@ # other nheko + cinny-desktop brave vieb bitwarden diff --git a/home/programs/scripts.nix b/home/programs/scripts.nix index 39eabef..b4d8293 100644 --- a/home/programs/scripts.nix +++ b/home/programs/scripts.nix @@ -12,7 +12,6 @@ grim = "${pkgs.grim}/bin/grim"; slurp = "${pkgs.slurp}/bin/slurp"; amixer = "${pkgs.alsa-utils}/bin/amixer"; - swaybg = "${pkgs.swaybg}/bin/swaybg"; chafa = "${pkgs.chafa}/bin/chafa"; exiftool = "${pkgs.exiftool}/bin/exiftool"; wc = "${pkgs.coreutils}/bin/wc"; @@ -25,6 +24,7 @@ gawk = "${pkgs.gawk}/bin/awk"; hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker"; sed = "${pkgs.gnused}/bin/sed"; + lock = "${pkgs.hyprlock}/bin/hyprlock"; }; in { programs.scripts = [ @@ -279,7 +279,7 @@ in { sleep hibernate" | ${my-deps.menu}) case $res in - lock) swaylock;; + lock) ${my-deps.lock};; sleep) systemctl suspend;; hibernate) systemctl hibernate;; esac diff --git a/home/programs/work.nix b/home/programs/work.nix index 34c1511..491fe5c 100644 --- a/home/programs/work.nix +++ b/home/programs/work.nix @@ -34,8 +34,8 @@ in { ]; home.sessionVariables = { - CYPRESS_INSTALL_BINARY=0; - CYPRESS_RUN_BINARY="${pkgs.cypress}/bin/Cypress"; + CYPRESS_INSTALL_BINARY = 0; + CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress"; }; gtk.gtk3.bookmarks = [ diff --git a/lib/cypress.nix b/lib/cypress.nix index e1642ec..e735b87 100644 --- a/lib/cypress.nix +++ b/lib/cypress.nix @@ -12,4 +12,3 @@ final: prev: { }; }); } - diff --git a/nixos/modules/podman.nix b/nixos/modules/podman.nix index f9cd6a7..c6cda54 100644 --- a/nixos/modules/podman.nix +++ b/nixos/modules/podman.nix @@ -19,10 +19,10 @@ ${toString (builtins.map (mapping: "-p ${mapping}") ports)} \ ${toString (builtins.map (mapping: "-v ${mapping}") volumes)} \ ${ - if builtins.isNull envFile - then "" - else "--env-file ${toString envFile}" - } \ + if builtins.isNull envFile + then "" + else "--env-file ${toString envFile}" + } \ --detach --replace \ --name ${name} \ ${image} ${command} diff --git a/nixos/modules/work.nix b/nixos/modules/work.nix index 5360281..bb94cf9 100644 --- a/nixos/modules/work.nix +++ b/nixos/modules/work.nix @@ -22,7 +22,7 @@ in { # breaks some work projects ):< networking.stevenblack.enable = false; - nixpkgs.overlays = [ (import ../../lib/cypress.nix) ]; + nixpkgs.overlays = [(import ../../lib/cypress.nix)]; services.onedrive.enable = true; diff --git a/nixos/programs/cosmic.nix b/nixos/programs/cosmic.nix index 6372038..f343d5c 100644 --- a/nixos/programs/cosmic.nix +++ b/nixos/programs/cosmic.nix @@ -3,8 +3,8 @@ inputs.nixos-cosmic.nixosModules.default ]; nix.settings = { - substituters = [ "https://cosmic.cachix.org/" ]; - trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; + substituters = ["https://cosmic.cachix.org/"]; + trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="]; }; services.desktopManager.cosmic.enable = true; services.displayManager.cosmic-greeter.enable = true; diff --git a/nixos/programs/gamer.nix b/nixos/programs/gamer.nix index 67cc40e..b676f2e 100644 --- a/nixos/programs/gamer.nix +++ b/nixos/programs/gamer.nix @@ -1,4 +1,8 @@ -{lib, pkgs, ...}: { +{ + lib, + pkgs, + ... +}: { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam" diff --git a/nixos/workstation.nix b/nixos/workstation.nix index cf8ef14..2d9e181 100644 --- a/nixos/workstation.nix +++ b/nixos/workstation.nix @@ -27,6 +27,7 @@ networking.firewall.allowedTCPPorts = [4713]; security.pam.services.swaylock = {}; + security.pam.services.hyprlock = {}; security.polkit.enable = true; systemd.user.services.polkit-gnome-authentication-agent-1 = { description = "polkit-gnome-authentication-agent-1";