mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
nix: Add macOS launchd service to hm-module module (#110)
Home manager has the possibility to run macOS launchd services. These are automatically disabled when running on linux.
This commit is contained in:
@@ -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
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user