Skip to content

Commit

Permalink
feat(nix): updated home manager options from `programs.battery-notifi…
Browse files Browse the repository at this point in the history
…er` -> `services.battery-notifier`
  • Loading branch information
luisnquin committed Apr 6, 2024
1 parent 0065841 commit b3b7af4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 2311;
from = ["programs" "battery-notifier"];
to = ["services" "battery-notifier"];
})
];

options.services.battery-notifier = let
boundModule = types.submodule {
options = {
threshold = mkOption {
Expand Down Expand Up @@ -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) [
Expand Down

0 comments on commit b3b7af4

Please sign in to comment.