From dadccdbe20421d5a180d0c1d0651564e47afe769 Mon Sep 17 00:00:00 2001 From: Jade Date: Mon, 20 Nov 2023 19:43:38 +0100 Subject: [PATCH] make usbmuxd optional --- hosts/catbook-j/configuration.nix | 1 + .../monosodium-glutamate-g/configuration.nix | 2 +- modules/desktop/evremap.nix | 20 ++++++++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/hosts/catbook-j/configuration.nix b/hosts/catbook-j/configuration.nix index 35fd1e6..b0daeeb 100644 --- a/hosts/catbook-j/configuration.nix +++ b/hosts/catbook-j/configuration.nix @@ -19,6 +19,7 @@ social.enable = true; mail.enable = true; gaming.enable = true; + evremap.enable = true; }; terminal.enable = true; }; diff --git a/hosts/monosodium-glutamate-g/configuration.nix b/hosts/monosodium-glutamate-g/configuration.nix index 0fcf53a..2bc7bcf 100644 --- a/hosts/monosodium-glutamate-g/configuration.nix +++ b/hosts/monosodium-glutamate-g/configuration.nix @@ -37,8 +37,8 @@ cloud.enable = true; social.enable = true; gaming.enable = true; - ios-compat.enable = true; mail.enable = true; + evremap.enable = false; }; terminal.enable = true; }; diff --git a/modules/desktop/evremap.nix b/modules/desktop/evremap.nix index dc9be06..98e8380 100644 --- a/modules/desktop/evremap.nix +++ b/modules/desktop/evremap.nix @@ -1,5 +1,6 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: let + cfg = config.jade.desktop.evremap; evremap = pkgs.rustPlatform.buildRustPackage { pname = "evremap"; version = "0.1.0"; @@ -17,12 +18,17 @@ let nativeBuildInputs = [ pkgs.pkg-config ]; buildInputs = [ pkgs.libevdev ]; }; -in { - systemd.services.evremap = { - script = "${evremap}/bin/evremap remap ${../../other/remaps-${config.networking.hostName}.toml}"; - wantedBy = [ "multi-user.target" ]; - unitConfig = { - Restart = "on-failure"; +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"; + }; }; }; }