feat(hyprland): use hypridle instead of swayidle
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
aed252651f
commit
fd5a54017c
4 changed files with 84 additions and 25 deletions
49
flake.lock
49
flake.lock
|
@ -451,10 +451,31 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hypridle": {
|
||||||
|
"inputs": {
|
||||||
|
"hyprlang": "hyprlang",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1708453550,
|
||||||
|
"narHash": "sha256-KAjPEGjulric1CscaleMJmfsyR7s08j4gzYc6p23K1U=",
|
||||||
|
"owner": "hyprwm",
|
||||||
|
"repo": "hypridle",
|
||||||
|
"rev": "158c52c4a76cff7a1635be8ec1a4a369bc8674ed",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hyprwm",
|
||||||
|
"repo": "hypridle",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"hyprland": {
|
"hyprland": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprland-protocols": "hyprland-protocols",
|
"hyprland-protocols": "hyprland-protocols",
|
||||||
"hyprlang": "hyprlang",
|
"hyprlang": "hyprlang_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
|
@ -502,6 +523,27 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hyprlang": {
|
"hyprlang": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"hypridle",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1708212860,
|
||||||
|
"narHash": "sha256-nW3Zrhh9RJcMTvOcXAaKADnJM/g6tDf3121lJtTHnYo=",
|
||||||
|
"owner": "hyprwm",
|
||||||
|
"repo": "hyprlang",
|
||||||
|
"rev": "11d5ccda071c153dfdc18ef65338956a51cef96a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hyprwm",
|
||||||
|
"repo": "hyprlang",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hyprlang_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
|
@ -522,7 +564,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hyprlang_2": {
|
"hyprlang_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
|
@ -1249,6 +1291,7 @@
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"hycov": "hycov",
|
"hycov": "hycov",
|
||||||
"hyprgrass": "hyprgrass",
|
"hyprgrass": "hyprgrass",
|
||||||
|
"hypridle": "hypridle",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"modernx-src": "modernx-src",
|
"modernx-src": "modernx-src",
|
||||||
"nh": "nh",
|
"nh": "nh",
|
||||||
|
@ -1489,7 +1532,7 @@
|
||||||
"hyprland",
|
"hyprland",
|
||||||
"hyprland-protocols"
|
"hyprland-protocols"
|
||||||
],
|
],
|
||||||
"hyprlang": "hyprlang_2",
|
"hyprlang": "hyprlang_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
|
|
@ -189,6 +189,13 @@
|
||||||
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
hypridle = {
|
||||||
|
type = "github";
|
||||||
|
owner = "hyprwm";
|
||||||
|
repo = "hypridle";
|
||||||
|
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# FIXME: https://github.com/horriblename/hyprgrass/issues/76
|
# FIXME: https://github.com/horriblename/hyprgrass/issues/76
|
||||||
hyprgrass = {
|
hyprgrass = {
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
hypridle,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) optionals;
|
inherit (lib) mkIf;
|
||||||
inherit (config.vars) mainUser;
|
inherit (config.vars) mainUser;
|
||||||
|
|
||||||
isLaptop = config.services.logind.lidSwitch == "lock";
|
isLaptop = config.services.logind.lidSwitch == "lock";
|
||||||
|
@ -16,26 +17,41 @@ in {
|
||||||
security.pam.services.swaylock = {};
|
security.pam.services.swaylock = {};
|
||||||
services.gnome.gnome-keyring.enable = true;
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
|
||||||
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
|
||||||
|
hmCfg.programs.swaylock.package
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
ags -r 'Tablet.setLaptopMode()'
|
||||||
|
swaylock -C ${hmCfg.xdg.configHome}/swaylock/config
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../../home/swaylock.nix
|
../../home/swaylock.nix
|
||||||
|
hypridle.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; ([
|
home.packages = with pkgs; [
|
||||||
gnome.seahorse
|
gnome.seahorse
|
||||||
]
|
];
|
||||||
++ optionals isLaptop [
|
|
||||||
swayidle
|
services.hypridle = mkIf isLaptop {
|
||||||
]);
|
enable = true;
|
||||||
|
listeners = [];
|
||||||
|
lockCmd = "${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 ["swayidle -w lock lock"];
|
|
||||||
|
|
||||||
windowrule = [
|
windowrule = [
|
||||||
"float,^(org.kde.polkit-kde-authentication-agent-1)$"
|
"float,^(org.kde.polkit-kde-authentication-agent-1)$"
|
||||||
|
@ -48,7 +64,7 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
bind = [
|
bind = [
|
||||||
"$mainMod, L, exec, lock"
|
"$mainMod, L, exec, ${lockPkg}/bin/lock"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
home.packages = [
|
|
||||||
(pkgs.writeShellScriptBin "lock" ''
|
|
||||||
ags -r 'Tablet.setLaptopMode()'
|
|
||||||
swaylock
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.swaylock = {
|
programs.swaylock = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.swaylock-effects;
|
package = pkgs.swaylock-effects;
|
Loading…
Reference in a new issue