diff --git a/home-modules/common.nix b/home-modules/common.nix index 41467c3..34adf39 100644 --- a/home-modules/common.nix +++ b/home-modules/common.nix @@ -6,7 +6,6 @@ systemd.user.startServices = "sd-switch"; services = { - easyeffects.enable = true; udiskie.enable = true; }; diff --git a/home-modules/default.nix b/home-modules/default.nix index da43a63..8f222a7 100644 --- a/home-modules/default.nix +++ b/home-modules/default.nix @@ -1,5 +1,6 @@ # Reusable Home-manager modules rec { + easyeffects = import ./easyeffects; polybar = import ./polybar; xmonad = import ./xmonad; common = import ./common.nix; @@ -29,6 +30,7 @@ rec { zsh = import ./zsh.nix; default-modules = [ + easyeffects polybar xmonad common diff --git a/home-modules/easyeffects/default.nix b/home-modules/easyeffects/default.nix new file mode 100644 index 0000000..97f2397 --- /dev/null +++ b/home-modules/easyeffects/default.nix @@ -0,0 +1,26 @@ +{ + imports = [ + ./preset.nix + ]; + + services.easyeffects = { + enable = true; + + presets = [ + { + # Antlion Modmic Wireless + device = "alsa_input.usb-Antlion_Audio_Antlion_Wireless_Microphone-00.mono-fallback"; + file = ./presets/Modmic.json; + type = "input"; + profile = "analog-input-mic"; + } + { + # Sennheiser HD6XX - Harman target + device = "alsa_output.usb-Topping_D10-00.HiFi__hw_D10_0__sink"; + file = ./presets/HD6XX.json; + type = "output"; + profile = "[Out] Headphones"; + } + ]; + }; +} diff --git a/home-modules/easyeffects/preset.nix b/home-modules/easyeffects/preset.nix new file mode 100644 index 0000000..b61e24d --- /dev/null +++ b/home-modules/easyeffects/preset.nix @@ -0,0 +1,57 @@ +{ + lib, + config, + ... +}: +with lib; let + cfg = config.services.easyeffects; +in { + options = { + services.easyeffects.presets = mkOption { + type = types.listOf (types.submodule { + options = { + device = mkOption { + type = types.str; + }; + type = mkOption { + type = types.enum ["input" "output"]; + }; + profile = mkOption { + type = types.str; + }; + file = mkOption { + type = types.path; + }; + description = mkOption { + type = types.str; + default = "Created by Home Manager"; + }; + }; + }); + }; + }; + config = { + xdg.configFile = lib.mergeAttrsList ( + map ({ + device, + type, + profile, + file, + description, + }: let + name = builtins.head (lib.splitString "." (builtins.baseNameOf file)); + in { + "easyeffects/${type}/${name}.json".source = file; + "easyeffects/autoload/${type}/${device}.json".text = + builtins.toJSON + { + device = device; + device-description = description; + device-profile = profile; + preset-name = name; + }; + }) + cfg.presets + ); + }; +} diff --git a/home-modules/easyeffects/presets/HD6XX.json b/home-modules/easyeffects/presets/HD6XX.json new file mode 100644 index 0000000..4c9795c --- /dev/null +++ b/home-modules/easyeffects/presets/HD6XX.json @@ -0,0 +1,243 @@ +{ + "output": { + "blocklist": [], + "equalizer#0": { + "balance": 0.0, + "bypass": false, + "input-gain": -7.9, + "left": { + "band0": { + "frequency": 31.5, + "gain": 7.9, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band1": { + "frequency": 63.0, + "gain": 3.9, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 125.0, + "gain": -0.8, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 250.0, + "gain": -1.9, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 500.0, + "gain": 0.0, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 1000.0, + "gain": -0.4, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 2000.0, + "gain": 1.6, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 4000.0, + "gain": 2.6, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 8000.0, + "gain": 2.0, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 16000.0, + "gain": 0.0, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 0.0, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 31.5, + "gain": 7.9, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band1": { + "frequency": 63.0, + "gain": 3.9, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 125.0, + "gain": -0.8, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 250.0, + "gain": -1.9, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 500.0, + "gain": 0.0, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 1000.0, + "gain": -0.4, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 2000.0, + "gain": 1.6, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 4000.0, + "gain": 2.6, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 8000.0, + "gain": 2.0, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 16000.0, + "gain": 0.0, + "mode": "APO (DR)", + "mute": false, + "q": 1.41, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0" + ] + } +} diff --git a/home-modules/easyeffects/presets/Modmic.json b/home-modules/easyeffects/presets/Modmic.json new file mode 100644 index 0000000..4034e9c --- /dev/null +++ b/home-modules/easyeffects/presets/Modmic.json @@ -0,0 +1,50 @@ +{ + "input": { + "blocklist": [], + "compressor#0": { + "attack": 20.0, + "boost-amount": 6.0, + "boost-threshold": -72.0, + "bypass": false, + "dry": -100.0, + "hpf-frequency": 10.0, + "hpf-mode": "off", + "input-gain": 0.0, + "knee": -8.0, + "lpf-frequency": 20000.0, + "lpf-mode": "off", + "makeup": 0.0, + "mode": "Boosting", + "output-gain": 0.0, + "ratio": 4.0, + "release": 100.0, + "release-threshold": -100.0, + "sidechain": { + "lookahead": 0.0, + "mode": "RMS", + "preamp": 0.0, + "reactivity": 10.0, + "source": "Middle", + "stereo-split-source": "Left/Right", + "type": "Feed-forward" + }, + "stereo-split": false, + "threshold": -20.0, + "wet": 0.0 + }, + "plugins_order": [ + "rnnoise#0", + "compressor#0" + ], + "rnnoise#0": { + "bypass": false, + "enable-vad": false, + "input-gain": 0.0, + "model-path": "", + "output-gain": 0.0, + "release": 20.0, + "vad-thres": 10.0, + "wet": 0.0 + } + } +}