dotfiles/nixos/systems/omen/inputplug.nix

31 lines
542 B
Nix
Raw Normal View History

{...}: {
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}'';
};
};
})
];
}