dotfiles/nixos/systems/omen/inputplug.nix
magic_rb f1658a7a56
omen: add input_plug
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-10-27 11:44:39 +01:00

31 lines
542 B
Nix

{...}: {
home."main".modules = [
({
pkgs,
lib,
...
}: let
inherit
(lib)
getExe
;
script = pkgs.writeShellScript "inputplug.sh" ''
mkdir -p $HOME/.cache/inputplug
EVENT_TYPE="$1"
DEVICE_ID="$2"
DEVICE_TYPE="$3"
DEVICE_NAME="$4"
'';
in {
systemd.user.services."inputplug" = {
Service = {
Type = "simple";
ExecStart = ''${getExe pkgs.inputplug} -c ${script}'';
};
};
})
];
}