mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-11-25 14:28:44 +01:00
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
cfg = config.jade.desktop.evremap;
|
|
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];
|
|
};
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
}
|