Skip to content

Commit

Permalink
{hypridle, hyrpaper}: remove with lib; (#6318)
Browse files Browse the repository at this point in the history
* hypridle: remove with lib;

* hyprpaper: remove with lib;
  • Loading branch information
khaneliman authored Jan 18, 2025
1 parent 1c75a4c commit 97d7946
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
19 changes: 8 additions & 11 deletions modules/services/hypridle.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let

cfg = config.services.hypridle;
let cfg = config.services.hypridle;
in {
meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ];
meta.maintainers = with lib.maintainers; [ khaneliman fufexan ];

options.services.hypridle = {
enable = mkEnableOption "Hypridle, Hyprland's idle daemon";
enable = lib.mkEnableOption "Hypridle, Hyprland's idle daemon";

package = mkPackageOption pkgs "hypridle" { };
package = lib.mkPackageOption pkgs "hypridle" { };

settings = lib.mkOption {
type = with lib.types;
Expand Down Expand Up @@ -65,8 +62,8 @@ in {
};
};

config = mkIf cfg.enable {
xdg.configFile."hypr/hypridle.conf" = mkIf (cfg.settings != { }) {
config = lib.mkIf cfg.enable {
xdg.configFile."hypr/hypridle.conf" = lib.mkIf (cfg.settings != { }) {
text = lib.hm.generators.toHyprconf {
attrs = cfg.settings;
inherit (cfg) importantPrefixes;
Expand All @@ -81,12 +78,12 @@ in {
Description = "hypridle";
After = [ config.wayland.systemd.target ];
PartOf = [ config.wayland.systemd.target ];
X-Restart-Triggers = mkIf (cfg.settings != { })
X-Restart-Triggers = lib.mkIf (cfg.settings != { })
[ "${config.xdg.configFile."hypr/hypridle.conf".source}" ];
};

Service = {
ExecStart = "${getExe cfg.package}";
ExecStart = "${lib.getExe cfg.package}";
Restart = "always";
RestartSec = "10";
};
Expand Down
19 changes: 8 additions & 11 deletions modules/services/hyprpaper.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let

cfg = config.services.hyprpaper;
let cfg = config.services.hyprpaper;
in {
meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ];
meta.maintainers = with lib.maintainers; [ khaneliman fufexan ];

options.services.hyprpaper = {
enable = mkEnableOption "Hyprpaper, Hyprland's wallpaper daemon";
enable = lib.mkEnableOption "Hyprpaper, Hyprland's wallpaper daemon";

package = mkPackageOption pkgs "hyprpaper" { };
package = lib.mkPackageOption pkgs "hyprpaper" { };

settings = lib.mkOption {
type = with lib.types;
Expand Down Expand Up @@ -59,8 +56,8 @@ in {
};
};

config = mkIf cfg.enable {
xdg.configFile."hypr/hyprpaper.conf" = mkIf (cfg.settings != { }) {
config = lib.mkIf cfg.enable {
xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf (cfg.settings != { }) {
text = lib.hm.generators.toHyprconf {
attrs = cfg.settings;
inherit (cfg) importantPrefixes;
Expand All @@ -75,12 +72,12 @@ in {
Description = "hyprpaper";
After = [ config.wayland.systemd.target ];
PartOf = [ config.wayland.systemd.target ];
X-Restart-Triggers = mkIf (cfg.settings != { })
X-Restart-Triggers = lib.mkIf (cfg.settings != { })
[ "${config.xdg.configFile."hypr/hyprpaper.conf".source}" ];
};

Service = {
ExecStart = "${getExe cfg.package}";
ExecStart = "${lib.getExe cfg.package}";
Restart = "always";
RestartSec = "10";
};
Expand Down

0 comments on commit 97d7946

Please sign in to comment.