From 9dc978dd057e43ee3752f4955e4701b13411f77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Sat, 6 Apr 2024 12:40:31 -0500 Subject: [PATCH] feat(nix): updated home manager options from `programs.battery-notifier` -> `services.battery-notifier` --- README.md | 2 +- nix/hm-module.nix | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dba9c62..3e10d00 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ If you use [Home Manager](https://github.com/nix-community/home-manager) to mana modules = [ battery-notifier.homeManagerModule.default { - programs.battery-notifier = { + services.battery-notifier = { enable = true; settings = { icon_path = ../assets/icons/battery-notifier.png; # Nix path diff --git a/nix/hm-module.nix b/nix/hm-module.nix index b3e3178..9045ec9 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -9,7 +9,15 @@ with lib; let tomlFormat = pkgs.formats.toml {}; flake-pkgs = self.packages.${system}; in { - options.programs.battery-notifier = let + imports = [ + (lib.mkRenamedOptionModuleWith { + sinceRelease = 2405; + from = ["programs" "battery-notifier"]; + to = ["services" "battery-notifier"]; + }) + ]; + + options.services.battery-notifier = let boundModule = types.submodule { options = { threshold = mkOption { @@ -72,7 +80,7 @@ in { }; config = let - cfg = config.programs.battery-notifier; + cfg = config.services.battery-notifier; in mkIf cfg.enable { assertions = mkIf (cfg.settings != null) [