nixos-config/home-manager/modules/xbanish/default.nix
2022-11-11 11:54:21 +01:00

37 lines
792 B
Nix

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.eboskma.services.xbanish;
in
{
options.eboskma.services.xbanish = {
enable = mkEnableOption "xbanish";
arguments = mkOption {
description = "Arguments to pass to xbanish command";
default = "";
example = "-d -i shift";
type = types.str;
};
};
config = mkIf (cfg.enable) {
systemd.user.services.xbanish = {
Unit = {
Description = "xbanish hides the mouse pointer when typing";
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStart = ''
${pkgs.xbanish}/bin/xbanish ${cfg.arguments}
'';
Restart = "always";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
}