Skip to content

Commit

Permalink
Add module for defining easyeffects presets
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Apr 27, 2024
1 parent 4b84d15 commit 89362a2
Show file tree
Hide file tree
Showing 6 changed files with 378 additions and 1 deletion.
1 change: 0 additions & 1 deletion home-modules/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
systemd.user.startServices = "sd-switch";

services = {
easyeffects.enable = true;
udiskie.enable = true;
};

Expand Down
2 changes: 2 additions & 0 deletions home-modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reusable Home-manager modules
rec {
easyeffects = import ./easyeffects;
polybar = import ./polybar;
xmonad = import ./xmonad;
common = import ./common.nix;
Expand Down Expand Up @@ -29,6 +30,7 @@ rec {
zsh = import ./zsh.nix;

default-modules = [
easyeffects
polybar
xmonad
common
Expand Down
26 changes: 26 additions & 0 deletions home-modules/easyeffects/default.nix
Original file line number Diff line number Diff line change
@@ -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";
}
];
};
}
57 changes: 57 additions & 0 deletions home-modules/easyeffects/preset.nix
Original file line number Diff line number Diff line change
@@ -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
);
};
}
243 changes: 243 additions & 0 deletions home-modules/easyeffects/presets/HD6XX.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
Loading

0 comments on commit 89362a2

Please sign in to comment.