1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

treewide: remove with lib (#6871)

Remove from services.
This commit is contained in:
Austin Horstman 2025-04-21 09:00:59 -07:00 committed by GitHub
parent 6695b1d477
commit 82ee14ff60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
124 changed files with 1848 additions and 1891 deletions

View file

@ -5,15 +5,18 @@
...
}:
with lib;
let
inherit (lib)
mkOption
types
literalExpression
;
cfg = config.services.swayidle;
in
{
meta.maintainers = [ maintainers.c0deaddict ];
meta.maintainers = [ lib.maintainers.c0deaddict ];
options.services.swayidle =
let
@ -64,7 +67,7 @@ in
in
{
enable = mkEnableOption "idle manager for Wayland";
enable = lib.mkEnableOption "idle manager for Wayland";
package = lib.mkPackageOption pkgs "swayidle" { };
@ -110,9 +113,9 @@ in
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.swayidle" pkgs platforms.linux)
(lib.hm.assertions.assertPlatform "services.swayidle" pkgs lib.platforms.linux)
];
systemd.user.services.swayidle = {
@ -128,7 +131,7 @@ in
Type = "simple";
Restart = "always";
# swayidle executes commands using "sh -c", so the PATH needs to contain a shell.
Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ];
Environment = [ "PATH=${lib.makeBinPath [ pkgs.bash ]}" ];
ExecStart =
let
mkTimeout =
@ -138,7 +141,7 @@ in
(toString t.timeout)
t.command
]
++ optionals (t.resumeCommand != null) [
++ lib.optionals (t.resumeCommand != null) [
"resume"
t.resumeCommand
];
@ -148,9 +151,10 @@ in
e.command
];
args = cfg.extraArgs ++ (concatMap mkTimeout cfg.timeouts) ++ (concatMap mkEvent cfg.events);
args =
cfg.extraArgs ++ (lib.concatMap mkTimeout cfg.timeouts) ++ (lib.concatMap mkEvent cfg.events);
in
"${getExe cfg.package} ${escapeShellArgs args}";
"${lib.getExe cfg.package} ${lib.escapeShellArgs args}";
};
Install = {