Compare commits
No commits in common. "a72a054632526b8d513f55827b2d1692fac94bf5" and "60de780156ca68355cfe72663f324d5365f1624b" have entirely different histories.
a72a054632
...
60de780156
6 changed files with 39 additions and 70 deletions
|
@ -10,15 +10,11 @@
|
|||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
|
||||
kernelParams = [
|
||||
"amd_pstate=active"
|
||||
];
|
||||
kernelModules = ["amdgpu" "kvm-amd" "acpi_call"];
|
||||
kernelParams = ["amd_pstate=active"];
|
||||
kernelModules = ["amdgpu" "kvm-amd"];
|
||||
|
||||
extraModulePackages = with config.boot.kernelPackages; [
|
||||
acpi_call
|
||||
zenpower
|
||||
];
|
||||
# Zenpower for ryzen cpu monitoring
|
||||
extraModulePackages = with config.boot.kernelPackages; [zenpower];
|
||||
blacklistedKernelModules = ["k10temp"];
|
||||
|
||||
initrd = {
|
||||
|
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
BIN
flake.nix
BIN
flake.nix
Binary file not shown.
|
@ -142,6 +142,11 @@ let
|
|||
repo = "Hyprspace";
|
||||
};
|
||||
|
||||
hypridle = mkDep {
|
||||
owner = "hyprwm";
|
||||
repo = "hypridle";
|
||||
};
|
||||
|
||||
grim-hyprland = mkDep {
|
||||
owner = "eriedaberrie";
|
||||
repo = "grim-hyprland";
|
||||
|
|
|
@ -207,10 +207,9 @@ const on_finished = () => {
|
|||
lock.connect('finished', on_finished);
|
||||
|
||||
if (Vars.hasFprintd) {
|
||||
globalThis.authFinger = () => Utils.authenticate('')
|
||||
Utils.authenticate('')
|
||||
.then(() => unlock())
|
||||
.catch(logError);
|
||||
globalThis.authFinger();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,44 +1,14 @@
|
|||
{
|
||||
config,
|
||||
hypridle,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf optionals;
|
||||
inherit (config.vars) mainUser;
|
||||
|
||||
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 {
|
||||
imports = [
|
||||
../greetd
|
||||
|
@ -46,41 +16,40 @@ in {
|
|||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
services.acpid = mkIf isLaptop {
|
||||
enable = true;
|
||||
|
||||
lidEventCommands = ''
|
||||
LID="/proc/acpi/button/lid/LID/state"
|
||||
state=$(cat "$LID" | ${pkgs.gawk}/bin/awk '{print $2}')
|
||||
|
||||
case "$state" in
|
||||
*open*)
|
||||
${runInDesktop}/bin/runInDesktop "ags -b lockscreen -r 'authFinger()'"
|
||||
;;
|
||||
|
||||
*close*)
|
||||
${runInDesktop}/bin/runInDesktop ${lockPkg}/bin/lock
|
||||
;;
|
||||
|
||||
*)
|
||||
logger -t lid-handler "Failed to detect lid state ($state)"
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
};
|
||||
|
||||
home-manager.users.${mainUser} = {
|
||||
home-manager.users.${mainUser} = let
|
||||
hmCfg = config.home-manager.users.${mainUser};
|
||||
lockPkg = pkgs.writeShellApplication {
|
||||
name = "lock";
|
||||
runtimeInputs = [
|
||||
hmCfg.programs.ags.finalPackage
|
||||
];
|
||||
text = ''
|
||||
ags -r 'Tablet.setLaptopMode()'
|
||||
ags -b lockscreen -c /home/${mainUser}/.config/ags/lockscreen.js
|
||||
'';
|
||||
};
|
||||
in {
|
||||
home.packages = [
|
||||
pkgs.gnome.seahorse
|
||||
lockPkg
|
||||
];
|
||||
|
||||
services.hypridle = mkIf isLaptop {
|
||||
enable = true;
|
||||
package = hypridle.packages.${pkgs.system}.default;
|
||||
settings.general.lock_cmd = "${lockPkg}/bin/lock";
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"gnome-keyring-daemon --start --components=secrets"
|
||||
"${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||
];
|
||||
exec-once =
|
||||
[
|
||||
"gnome-keyring-daemon --start --components=secrets"
|
||||
"${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
|
||||
]
|
||||
++ optionals isLaptop [
|
||||
"systemctl --user restart hypridle"
|
||||
];
|
||||
|
||||
windowrule = [
|
||||
"float,^(org.kde.polkit-kde-authentication-agent-1)$"
|
||||
|
|
Loading…
Reference in a new issue