diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 50bf13e..9484a37 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -24,7 +24,12 @@ in { systemd = mkOption { type = types.bool; default = pkgs.stdenv.isLinux; - description = "Whether to enable to systemd service for lan-mouse."; + description = "Whether to enable to systemd service for lan-mouse on linux."; + }; + launchd = mkOption { + type = types.bool; + default = pkgs.stdenv.isDarwin; + description = "Whether to enable to launchd service for lan-mouse on macOS."; }; settings = lib.mkOption { inherit (tomlFormat) type; @@ -55,6 +60,17 @@ in { ]; }; + launchd.agents.lan-mouse = lib.mkIf cfg.launchd { + enable = true; + config = { + ProgramArguments = [ + "${cfg.package}/bin/lan-mouse" + "--daemon" + ]; + KeepAlive = true; + }; + }; + home.packages = [ cfg.package ];