Compare commits

..

No commits in common. "a72a054632526b8d513f55827b2d1692fac94bf5" and "60de780156ca68355cfe72663f324d5365f1624b" have entirely different histories.

6 changed files with 39 additions and 70 deletions

View file

@ -10,15 +10,11 @@
boot = { boot = {
kernelPackages = pkgs.linuxPackages_zen; kernelPackages = pkgs.linuxPackages_zen;
kernelParams = [ kernelParams = ["amd_pstate=active"];
"amd_pstate=active" kernelModules = ["amdgpu" "kvm-amd"];
];
kernelModules = ["amdgpu" "kvm-amd" "acpi_call"];
extraModulePackages = with config.boot.kernelPackages; [ # Zenpower for ryzen cpu monitoring
acpi_call extraModulePackages = with config.boot.kernelPackages; [zenpower];
zenpower
];
blacklistedKernelModules = ["k10temp"]; blacklistedKernelModules = ["k10temp"];
initrd = { initrd = {

Binary file not shown.

BIN
flake.nix

Binary file not shown.

View file

@ -142,6 +142,11 @@ let
repo = "Hyprspace"; repo = "Hyprspace";
}; };
hypridle = mkDep {
owner = "hyprwm";
repo = "hypridle";
};
grim-hyprland = mkDep { grim-hyprland = mkDep {
owner = "eriedaberrie"; owner = "eriedaberrie";
repo = "grim-hyprland"; repo = "grim-hyprland";

View file

@ -207,10 +207,9 @@ const on_finished = () => {
lock.connect('finished', on_finished); lock.connect('finished', on_finished);
if (Vars.hasFprintd) { if (Vars.hasFprintd) {
globalThis.authFinger = () => Utils.authenticate('') Utils.authenticate('')
.then(() => unlock()) .then(() => unlock())
.catch(logError); .catch(logError);
globalThis.authFinger();
} }

View file

@ -1,44 +1,14 @@
{ {
config, config,
hypridle,
lib, lib,
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) mkIf; inherit (lib) mkIf optionals;
inherit (config.vars) mainUser; inherit (config.vars) mainUser;
isLaptop = config.services.logind.lidSwitch == "lock"; isLaptop = config.services.logind.lidSwitch == "lock";
hmCfg = config.home-manager.users.${mainUser};
agsPkg = hmCfg.programs.ags.finalPackage;
hyprPkg = hmCfg.wayland.windowManager.hyprland.finalPackage;
runInDesktop = pkgs.writeShellApplication {
name = "runInDesktop";
runtimeInputs = [
pkgs.sudo
agsPkg
hyprPkg
];
text = ''
user="$(id -u ${mainUser})"
sig="$(ls "/run/user/$user/hypr/")"
export HYPRLAND_INSTANCE_SIGNATURE="$sig"
sudo -Eu ${mainUser} hyprctl dispatch exec "$@"
'';
};
lockPkg = pkgs.writeShellApplication {
name = "lock";
runtimeInputs = [
agsPkg
];
text = ''
ags -r 'Tablet.setLaptopMode()'
ags -b lockscreen -c /home/${mainUser}/.config/ags/lockscreen.js
'';
};
in { in {
imports = [ imports = [
../greetd ../greetd
@ -46,40 +16,39 @@ in {
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
services.acpid = mkIf isLaptop { home-manager.users.${mainUser} = let
enable = true; hmCfg = config.home-manager.users.${mainUser};
lockPkg = pkgs.writeShellApplication {
lidEventCommands = '' name = "lock";
LID="/proc/acpi/button/lid/LID/state" runtimeInputs = [
state=$(cat "$LID" | ${pkgs.gawk}/bin/awk '{print $2}') hmCfg.programs.ags.finalPackage
];
case "$state" in text = ''
*open*) ags -r 'Tablet.setLaptopMode()'
${runInDesktop}/bin/runInDesktop "ags -b lockscreen -r 'authFinger()'" ags -b lockscreen -c /home/${mainUser}/.config/ags/lockscreen.js
;;
*close*)
${runInDesktop}/bin/runInDesktop ${lockPkg}/bin/lock
;;
*)
logger -t lid-handler "Failed to detect lid state ($state)"
;;
esac
''; '';
}; };
in {
home-manager.users.${mainUser} = {
home.packages = [ home.packages = [
pkgs.gnome.seahorse pkgs.gnome.seahorse
lockPkg lockPkg
]; ];
services.hypridle = mkIf isLaptop {
enable = true;
package = hypridle.packages.${pkgs.system}.default;
settings.general.lock_cmd = "${lockPkg}/bin/lock";
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
exec-once = [ exec-once =
[
"gnome-keyring-daemon --start --components=secrets" "gnome-keyring-daemon --start --components=secrets"
"${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1" "${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
]
++ optionals isLaptop [
"systemctl --user restart hypridle"
]; ];
windowrule = [ windowrule = [