29 lines
642 B
Nix
29 lines
642 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
cfg = config.local.services.lan-mouse;
|
|
|
|
# See: https://github.com/feschber/lan-mouse/blob/main/src/config.rs#L79
|
|
lanMouseConfig = pkgs.writeText "config.toml" ''
|
|
port = ${toString cfg.port}
|
|
'';
|
|
in
|
|
{
|
|
options.local.services.lan-mouse = with lib; {
|
|
enable = mkEnableOption "lan-mouse";
|
|
port = mkOption {
|
|
type = types.int;
|
|
default = 4242;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
programs.lan-mouse = {
|
|
enable = true;
|
|
systemd = true;
|
|
package = pkgs.unstable.lan-mouse;
|
|
};
|
|
|
|
xdg.configFile."lan-mouse/config.toml".source = lanMouseConfig;
|
|
};
|
|
}
|