nix-configs/modules/desktop/evremap.nix

40 lines
1 KiB
Nix
Raw Normal View History

{
pkgs,
config,
lib,
...
}: let
2023-11-20 18:43:38 +00:00
cfg = config.jade.desktop.evremap;
2023-11-14 12:43:01 +00:00
evremap = pkgs.rustPlatform.buildRustPackage {
pname = "evremap";
version = "0.1.0";
src = pkgs.fetchFromGitHub {
owner = "wez";
repo = "evremap";
rev = "4480c4eda223b98899b0fbd926bc34f7bd0e1a18";
sha256 = "sha256-BxSrphgW1n465FX6bKVkq6O0XE2JqanfSYlsGwWUWkQ=";
};
cargoHash = "";
cargoLock.lockFile = ../../other/evremap.Cargo.lock;
postPatch = ''
cp ${../../other/evremap.Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [pkgs.pkg-config];
buildInputs = [pkgs.libevdev];
2023-11-14 12:43:01 +00:00
};
in
with lib; {
options.jade.desktop.evremap = {
enable = mkEnableOption "Enable evremap";
};
config = mkIf cfg.enable {
systemd.services.evremap = {
script = "${evremap}/bin/evremap remap ${../../other/remaps-${config.networking.hostName}.toml}";
wantedBy = ["multi-user.target"];
unitConfig = {
Restart = "on-failure";
};
2023-11-20 18:43:38 +00:00
};
2023-11-17 10:53:59 +00:00
};
}