mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-17 21:51:03 +01:00
Pin keyd's right-hand modifiers (rightcontrol/rightshift/rightmeta) to their own keycodes; keyd otherwise folds them into the left keys. Set Vinput's MenuKey to right Ctrl and clear CommandKeys, which would shadow it.
83 lines
2.9 KiB
Nix
83 lines
2.9 KiB
Nix
{ pkgs, ... }:
|
|
{
|
|
#============================= Audio(PipeWire) =======================
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
# $ nix search wget
|
|
environment.systemPackages = with pkgs; [
|
|
pulseaudio # provides `pactl`, which is required by some apps(e.g. sonic-pi)
|
|
];
|
|
|
|
# PipeWire is a new low-level multimedia framework.
|
|
# It aims to offer capture and playback for both audio and video with minimal latency.
|
|
# It support for PulseAudio-, JACK-, ALSA- and GStreamer-based applications.
|
|
# PipeWire has a great bluetooth support, it can be a good alternative to PulseAudio.
|
|
# https://nixos.wiki/wiki/PipeWire
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
wireplumber.enable = true;
|
|
};
|
|
# rtkit is optional but recommended
|
|
security.rtkit.enable = true;
|
|
# Disable pulseaudio, it conflicts with pipewire too.
|
|
services.pulseaudio.enable = false;
|
|
|
|
#============================= Bluetooth =============================
|
|
|
|
# Pairing UI lives in Noctalia's bluetooth widget / control-center tab, which
|
|
# registers its own org.bluez pairing agent, so no blueman applet is needed.
|
|
# or you can use cli:
|
|
# $ bluetoothctl
|
|
# [bluetooth] # power on
|
|
# [bluetooth] # agent on
|
|
# [bluetooth] # default-agent
|
|
# [bluetooth] # scan on
|
|
# ...put device in pairing mode and wait [hex-address] to appear here...
|
|
# [bluetooth] # pair [hex-address]
|
|
# [bluetooth] # connect [hex-address]
|
|
# Bluetooth devices automatically connect with bluetoothctl as well:
|
|
# [bluetooth] # trust [hex-address]
|
|
hardware.bluetooth.enable = true;
|
|
|
|
#================================= Misc =================================
|
|
|
|
services = {
|
|
printing.enable = true; # Enable CUPS to print documents.
|
|
geoclue2.enable = true; # Enable geolocation services.
|
|
|
|
udev.packages = with pkgs; [
|
|
gnome-settings-daemon
|
|
# platformio # udev rules for platformio
|
|
# openocd # platformio needs these udev rules for rootless USB access
|
|
# openfpgaloader
|
|
];
|
|
|
|
# A key remapping daemon for linux.
|
|
# https://github.com/rvaiya/keyd
|
|
keyd = {
|
|
enable = true;
|
|
keyboards.default.settings = {
|
|
main = {
|
|
# overloads the capslock key to function as both escape (when tapped) and control (when held)
|
|
capslock = "overload(control, esc)";
|
|
esc = "capslock";
|
|
|
|
# keyd rewrites right-hand modifiers as their left counterparts, so
|
|
# pin them to their own keycodes. Vinput's MenuKey is right Ctrl and
|
|
# Rime's right Shift switches CN/EN.
|
|
rightcontrol = "rightcontrol";
|
|
rightshift = "rightshift";
|
|
rightmeta = "rightmeta";
|
|
|
|
# Right Alt is AltGr, the third-level shift on many European layouts
|
|
# (e.g. `AltGr+2` is `@` in Spanish); keyd forwards it as-is.
|
|
rightalt = "layer(altgr)";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|