added stuff
This commit is contained in:
parent
e8d9044d2b
commit
9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions
9
nyx/homes/notashelf/services/shared/media/default.nix
Normal file
9
nyx/homes/notashelf/services/shared/media/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./easyeffects
|
||||
./mpd
|
||||
|
||||
./noisetorch.nix
|
||||
./spotifyd.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
osConfig,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
dev = osConfig.modules.device;
|
||||
acceptedTypes = ["desktop" "laptop" "lite" "hybrid"];
|
||||
in {
|
||||
config = mkIf (builtins.elem dev.type acceptedTypes) {
|
||||
services.easyeffects = {
|
||||
enable = true;
|
||||
preset = "quiet";
|
||||
};
|
||||
|
||||
xdg.configFile."easyeffects/output/quiet.json".source = ./quiet.json;
|
||||
};
|
||||
}
|
258
nyx/homes/notashelf/services/shared/media/easyeffects/quiet.json
Normal file
258
nyx/homes/notashelf/services/shared/media/easyeffects/quiet.json
Normal file
|
@ -0,0 +1,258 @@
|
|||
{
|
||||
"output": {
|
||||
"blocklist": ["mpd", "mpd.pipewire"],
|
||||
"compressor#0": {
|
||||
"attack": 19.969999999999995,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"bypass": false,
|
||||
"dry": -100.0,
|
||||
"hpf-frequency": 10.0,
|
||||
"hpf-mode": "off",
|
||||
"input-gain": 14.9,
|
||||
"knee": -6.499999999999998,
|
||||
"lpf-frequency": 20000.0,
|
||||
"lpf-mode": "off",
|
||||
"makeup": 0.0,
|
||||
"mode": "Upward",
|
||||
"output-gain": -8.3,
|
||||
"ratio": 3.9400000000000013,
|
||||
"release": 100.0,
|
||||
"release-threshold": -100.0,
|
||||
"sidechain": {
|
||||
"lookahead": 0.0,
|
||||
"mode": "RMS",
|
||||
"preamp": 0.0,
|
||||
"reactivity": 10.0,
|
||||
"source": "Middle",
|
||||
"type": "Feed-forward"
|
||||
},
|
||||
"threshold": -12.0,
|
||||
"wet": 0.0
|
||||
},
|
||||
"multiband_compressor#0": {
|
||||
"band0": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 500.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 10.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false
|
||||
},
|
||||
"band1": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": true,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 1000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 500.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 500.0
|
||||
},
|
||||
"band2": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": true,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 2000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 1000.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 1000.0
|
||||
},
|
||||
"band3": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": true,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 4000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 2000.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 2000.0
|
||||
},
|
||||
"band4": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": false,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 8000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 4000.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 4000.0
|
||||
},
|
||||
"band5": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": false,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 12000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 8000.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 8000.0
|
||||
},
|
||||
"band6": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": false,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 16000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 12000.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 12000.0
|
||||
},
|
||||
"band7": {
|
||||
"attack-threshold": -12.0,
|
||||
"attack-time": 20.0,
|
||||
"boost-amount": 6.0,
|
||||
"boost-threshold": -72.0,
|
||||
"compression-mode": "Downward",
|
||||
"compressor-enable": true,
|
||||
"enable-band": false,
|
||||
"external-sidechain": false,
|
||||
"knee": -6.0,
|
||||
"makeup": 0.0,
|
||||
"mute": false,
|
||||
"ratio": 1.0,
|
||||
"release-threshold": -100.0,
|
||||
"release-time": 100.0,
|
||||
"sidechain-custom-highcut-filter": false,
|
||||
"sidechain-custom-lowcut-filter": false,
|
||||
"sidechain-highcut-frequency": 20000.0,
|
||||
"sidechain-lookahead": 0.0,
|
||||
"sidechain-lowcut-frequency": 16000.0,
|
||||
"sidechain-mode": "RMS",
|
||||
"sidechain-preamp": 0.0,
|
||||
"sidechain-reactivity": 10.0,
|
||||
"sidechain-source": "Middle",
|
||||
"solo": false,
|
||||
"split-frequency": 16000.0
|
||||
},
|
||||
"bypass": true,
|
||||
"compressor-mode": "Modern",
|
||||
"dry": -100.0,
|
||||
"envelope-boost": "None",
|
||||
"input-gain": 19.2,
|
||||
"output-gain": -0.8,
|
||||
"wet": 0.0
|
||||
},
|
||||
"plugins_order": ["multiband_compressor#0", "compressor#0"]
|
||||
}
|
||||
}
|
111
nyx/homes/notashelf/services/shared/media/mpd/default.nix
Normal file
111
nyx/homes/notashelf/services/shared/media/mpd/default.nix
Normal file
|
@ -0,0 +1,111 @@
|
|||
{
|
||||
osConfig,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (osConfig) modules;
|
||||
|
||||
env = modules.usrEnv;
|
||||
srv = env.services;
|
||||
in {
|
||||
config = mkIf srv.media.mpd.enable {
|
||||
home.packages = with pkgs; [
|
||||
playerctl # CLI interface for playerctld
|
||||
mpc_cli # CLI interface for mpd
|
||||
cava # CLI music visualizer (cavalier is a gui alternative)
|
||||
];
|
||||
|
||||
services = {
|
||||
playerctld.enable = true;
|
||||
mpris-proxy.enable = true;
|
||||
mpd-mpris.enable = true;
|
||||
|
||||
# music player daemon service
|
||||
mpd = {
|
||||
enable = true;
|
||||
musicDirectory = "${config.home.homeDirectory}/Media/Music";
|
||||
network = {
|
||||
startWhenNeeded = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
port = 6600;
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
auto_update "yes"
|
||||
volume_normalization "yes"
|
||||
restore_paused "yes"
|
||||
filesystem_charset "UTF-8"
|
||||
|
||||
audio_output {
|
||||
type "pipewire"
|
||||
name "PipeWire"
|
||||
}
|
||||
|
||||
audio_output {
|
||||
type "fifo"
|
||||
name "Visualiser"
|
||||
path "/tmp/mpd.fifo"
|
||||
format "44100:16:2"
|
||||
}
|
||||
|
||||
audio_output {
|
||||
type "httpd"
|
||||
name "lossless"
|
||||
encoder "flac"
|
||||
port "8000"
|
||||
max_clients "8"
|
||||
mixer_type "software"
|
||||
format "44100:16:2"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
# MPRIS 2 support to mpd
|
||||
mpdris2 = {
|
||||
enable = true;
|
||||
notifications = true;
|
||||
multimediaKeys = true;
|
||||
mpd = {
|
||||
# for some reason config.xdg.userDirs.music is not a "path" - possibly because it has $HOME in its name?
|
||||
inherit (config.services.mpd) musicDirectory;
|
||||
};
|
||||
};
|
||||
|
||||
# discord rich presence for mpd
|
||||
mpd-discord-rpc = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = {
|
||||
details = "$title";
|
||||
state = "On $album by $artist";
|
||||
large_text = "$album";
|
||||
small_image = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
/*
|
||||
# yams service
|
||||
# TODO: figure out a way to provide the lastfm authentication declaratively
|
||||
|
||||
systemd.user.services.yams = {
|
||||
Unit = {
|
||||
Description = "Last.FM scrobbler for MPD";
|
||||
After = ["mpd.service"];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.yams}/bin/yams -N";
|
||||
Environment = "NON_INTERACTIVE=1";
|
||||
Restart = "always";
|
||||
};
|
||||
Install.WantedBy = ["default.target"];
|
||||
};
|
||||
*/
|
||||
};
|
||||
};
|
||||
}
|
64
nyx/homes/notashelf/services/shared/media/noisetorch.nix
Normal file
64
nyx/homes/notashelf/services/shared/media/noisetorch.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
osConfig,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption mkOption literalExpression types;
|
||||
|
||||
cfg = config.services.noisetorch;
|
||||
|
||||
dev = osConfig.modules.device;
|
||||
|
||||
acceptedTypes = ["desktop" "laptop" "lite" "hybrid"];
|
||||
in {
|
||||
options = {
|
||||
services.noisetorch = {
|
||||
enable = mkEnableOption "noisetorch service";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.noisetorch;
|
||||
defaultText = literalExpression "pkgs.noisetorch";
|
||||
description = "Which package to use for noisetorch";
|
||||
};
|
||||
threshold = mkOption {
|
||||
type = types.int;
|
||||
default = -1;
|
||||
description = "Voice activation threshold (default -1)";
|
||||
};
|
||||
device = mkOption {
|
||||
type = types.str;
|
||||
description = "Use the specified source/sink device ID";
|
||||
};
|
||||
deviceUnit = mkOption {
|
||||
type = types.str;
|
||||
description = "Systemd device unit which is providing the audio device";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && builtins.elem dev.type acceptedTypes) {
|
||||
home.packages = [cfg.package];
|
||||
|
||||
systemd.user.services.noisetorch = {
|
||||
Unit = {
|
||||
Description = "Noisetorch Noise Cancelling";
|
||||
Requires = "${cfg.deviceUnit}";
|
||||
After = "${cfg.deviceUnit}";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["default.target"];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
RemainAfterExit = "yes";
|
||||
ExecStart = "${cfg.package}/bin/noisetorch -i -s ${cfg.device} -t ${builtins.toString cfg.threshold}";
|
||||
ExecStop = "${cfg.package}/bin/noisetorch -u";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
Nice = -10;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
38
nyx/homes/notashelf/services/shared/media/spotifyd.nix
Normal file
38
nyx/homes/notashelf/services/shared/media/spotifyd.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
osConfig,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
dev = osConfig.modules.device;
|
||||
|
||||
credientals = {
|
||||
password_cmd = "${pkgs.coreutils}/bin/tail -1 /run/agenix/spotify";
|
||||
username_cmd = "${pkgs.coreutils}/bin/head -1 /run/agenix/spotify";
|
||||
};
|
||||
|
||||
acceptedTypes = ["desktop" "laptop" "lite" "hybrid"];
|
||||
in {
|
||||
config = mkIf (builtins.elem dev.type acceptedTypes) {
|
||||
services = {
|
||||
spotifyd = {
|
||||
enable = false;
|
||||
package = pkgs.spotifyd.override {withMpris = true;};
|
||||
settings.global = {
|
||||
inherit (credientals) password_cmd username_cmd;
|
||||
cache_path = "${config.xdg.cacheHome}/spotifyd";
|
||||
device_type = "computer";
|
||||
use_mpris = true;
|
||||
autoplay = true;
|
||||
|
||||
# audio settings
|
||||
volume_normalisation = true;
|
||||
backend = "pulseaudio";
|
||||
bitrate = 320;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue