🔧 sharpen the xorg component a bit

This commit is contained in:
Ingolf Wagner 2025-02-18 17:08:58 +13:00
parent 9e96d809d3
commit b838caa222
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
5 changed files with 144 additions and 101 deletions

View file

@ -12,45 +12,54 @@ with lib;
default = config.components.gui.enable;
};
config = mkIf (config.components.gui.audio.enable) {
config = mkMerge [
(mkIf (config.components.gui.audio.enable) {
security.rtkit.enable = true;
security.rtkit.enable = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.pulseaudio.enable = false;
environment.systemPackages = with pkgs; [
alsa-utils
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
# PulseAudio control
# ------------------
ponymix
pavucontrol
lxqt.pavucontrol-qt
];
environment.systemPackages = with pkgs; [
alsa-utils
services.pipewire = {
#enable = true;
systemWide = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# PulseAudio control
# ------------------
ponymix
pavucontrol
lxqt.pavucontrol-qt
];
environment.etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'';
};
})
services.pipewire = {
enable = true;
systemWide = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
{
environment.etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'';
};
};
# this is always true
# seems other options enable this one
services.pipewire.enable = config.components.gui.audio.enable;
services.pulseaudio.enable = false;
}
];
}

View file

@ -16,6 +16,7 @@ with lib;
./browser.nix
./cups.nix
./home-manager
./kde.nix
./kmonad.nix
./noti.nix # todo: make this different (use password store and such)
./pass.nix

19
components/gui/kde.nix Normal file
View file

@ -0,0 +1,19 @@
{
config,
pkgs,
lib,
...
}:
{
options.components.gui.kde.enable = lib.mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
};
config = lib.mkIf (config.components.gui.kde.enable) {
services.desktopManager.plasma6.enable = true;
};
}

View file

@ -14,72 +14,85 @@ with lib;
default = config.components.gui.enable;
};
config = mkIf (config.components.gui.xorg.enable && config.components.gui.enable) {
# system.custom.fonts.enable = true;
services.displayManager = {
defaultSession = lib.mkDefault "none+i3";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = config.users.users.mainUser.name;
};
services.xserver = {
enable = true;
displayManager = {
lightdm.enable = lib.mkDefault true;
};
desktopManager.xterm.enable = false;
windowManager.i3.enable = true;
# mouse/touchpad
# --------------
};
services.libinput = {
enable = true;
touchpad = {
disableWhileTyping = true;
tapping = true;
scrollMethod = "twofinger";
accelSpeed = "1.3";
naturalScrolling = true;
horizontalScrolling = true;
};
};
# Packages
# --------
environment.systemPackages = with pkgs; [
xclip
#xtrlock-pam
xorg.xev
dmenu
arandr
xcalib
flameshot
feh
];
# Xresources config
# -----------------
# spread the Xresource config
# across different files
# just add a file into `/etc/X11/Xresource.d/` and it will be
# evaluated.
services.xserver.displayManager.sessionCommands = ''
for file in `ls /etc/X11/Xresource.d/`
do
${pkgs.xorg.xrdb}/bin/xrdb -merge /etc/X11/Xresource.d/$file
done
'';
environment.etc."/X11/Xresource.d/.keep".text = "";
options.components.gui.xorg.lightdm.enable = mkOption {
type = lib.types.bool;
default = config.components.gui.xorg.enable;
};
options.components.gui.xorg.sddm.enable = mkOption {
type = lib.types.bool;
default = !config.components.gui.xorg.lightdm.enable;
};
config = mkMerge [
(mkIf (config.components.gui.xorg.lightdm.enable && config.components.gui.xorg.enable) {
services.displayManager = {
defaultSession = "none+i3";
autoLogin.enable = lib.mkDefault true;
autoLogin.user = config.users.users.mainUser.name;
};
services.xserver.displayManager.lightdm.enable = true;
})
(mkIf (config.components.gui.xorg.sddm.enable && config.components.gui.xorg.enable) {
services.xserver.displayManager.sddm.enable = true;
})
(mkIf (config.components.gui.xorg.enable && config.components.gui.enable) {
services.xserver.enable = true;
services.xserver.windowManager.i3.enable = true;
services.libinput = {
enable = true;
touchpad = {
disableWhileTyping = true;
tapping = true;
scrollMethod = "twofinger";
accelSpeed = "1.3";
naturalScrolling = true;
horizontalScrolling = true;
};
};
# Packages
# --------
environment.systemPackages = with pkgs; [
xclip
#xtrlock-pam
xorg.xev
dmenu
arandr
xcalib
flameshot
feh
];
# Xresources config
# -----------------
# spread the Xresource config
# across different files
# just add a file into `/etc/X11/Xresource.d/` and it will be
# evaluated.
services.xserver.displayManager.sessionCommands = ''
for file in `ls /etc/X11/Xresource.d/`
do
${pkgs.xorg.xrdb}/bin/xrdb -merge /etc/X11/Xresource.d/$file
done
'';
environment.etc."/X11/Xresource.d/.keep".text = "";
})
];
}

View file

@ -55,6 +55,7 @@
components.virtualisation.enable = true;
components.gui.enable = true;
components.gui.audio.enable = false;
components.mainUser.enable = true;
components.media.enable = true;
components.media.tts-client.enable = false;