mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-03 13:36:12 +01:00
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}'';
|
||
|
};
|
||
|
};
|
||
|
})
|
||
|
];
|
||
|
}
|