mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 19:46:17 +01:00
f1658a7a56
Signed-off-by: magic_rb <magic_rb@redalder.org>
31 lines
542 B
Nix
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}'';
|
|
};
|
|
};
|
|
})
|
|
];
|
|
}
|