mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-17 08:21:29 +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 {
|
systemd = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = pkgs.stdenv.isLinux;
|
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 {
|
settings = lib.mkOption {
|
||||||
inherit (tomlFormat) type;
|
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 = [
|
home.packages = [
|
||||||
cfg.package
|
cfg.package
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user