Files
nevaforget dba33d2463 refactor(modules): one topic per module, and Firefox preconfigured
Two changes that cannot be separated in the result: the Firefox
preconfiguration is what made desktop.nix untenable, and the split is what it
now lives in.

Firefox replaces LibreWolf, with Betterfox as its preference base and the
settings that Betterfox does not cover expressed as policies: uBlock Origin,
the Catppuccin theme, no Pocket, no Sync, autoscroll, DuckDuckGo, no
translation offer, no password prompts, no bookmarks toolbar, about:blank as
home and new tab. Both add-ons are normal_installed and the preferences keep
status "default", so none of it is locked away — undoing settings by hand was
the reason to leave LibreWolf.

desktop.nix carried thirteen topics over 637 lines, and the existing split
followed the NixOS option namespace rather than the topic: services.pipewire
here, its configPackages there; services.gvfs and services.udisks2 apart from
their packages; Bluetooth likewise. Nine modules now each hold one topic with
its options, packages, configs and services together. desktop.nix keeps the
compositor, the /etc deployment, portals and what belongs to no topic.

The refactor changes nothing about the built system, and that was checked
after each of the eight steps rather than assumed. The plain store path does
not serve as the criterion: moving a package to another module reorders
environment.systemPackages, which changes the system-path hash and propagates
into every file naming it. What was compared instead is the package set
through diff-closures and every differing file with store hashes normalised
away. Two steps reordered the user tmpfiles list, which is neutral only
because no two rules name the same path — checked, not presumed.
2026-09-24 15:18:33 +02:00

50 lines
2.0 KiB
Nix

# ABOUTME: PipeWire and the RNNoise input denoising from the shared config.
# ABOUTME: Both halves in one place; they used to sit in two separate modules.
{ pkgs, moonarchSrc, ... }:
let
xdg = "${moonarchSrc}/defaults/xdg";
# PipeWire searches $PIPEWIRE_CONFIG_DIR, then $XDG_CONFIG_HOME/pipewire, then
# its compiled-in /etc/pipewire — never /etc/xdg (verified in PipeWire's
# src/pipewire/conf.c). The shared file therefore cannot be deployed the way
# the other XDG configs are; it goes through the module's configPackages,
# which is what its own option documentation shows for a conf.d file.
#
# The file names the plugin as `librnnoise_ladspa`, resolved through
# LADSPA_PATH, which points at nothing here. Substituted to the
# store path, the way modules/desktop.nix does it for the wallpaper. LADSPA
# has no counterpart to services.pipewire.extraLv2Packages, so the path
# belongs in the file.
denoisingConfig = pkgs.runCommand "moonarch-pipewire-denoising" { } ''
mkdir -p "$out/share/pipewire/pipewire.conf.d"
substitute ${xdg}/pipewire/pipewire.conf.d/99-input-denoising.conf \
"$out/share/pipewire/pipewire.conf.d/99-input-denoising.conf" \
--replace-fail "plugin = librnnoise_ladspa" \
"plugin = ${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so"
'';
in
{
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
# RNNoise input denoising, from the shared config. The filter chain appears
# as a separate "Noise Canceling source" input; it does not replace the raw
# microphone, so applications have to select it.
configPackages = [ denoisingConfig ];
};
# No pulseaudio for pactl: Steam probes wpctl and pactl both and takes
# whichever is on PATH (nixpkgs#525793), and wireplumber puts wpctl there.
# Its "pactl: command not found" is noise from Steam, not a gap.
environment.systemPackages = with pkgs; [
pavucontrol
alsa-utils
];
}