diff --git a/configurations/desktop/configuration.nix b/configurations/desktop/configuration.nix index 784c9360..3672420f 100644 --- a/configurations/desktop/configuration.nix +++ b/configurations/desktop/configuration.nix @@ -23,16 +23,26 @@ networking.networkmanager.enable = true; # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Enable the X11 windowing system. - services.xserver.enable = true; + services.xserver = { + # Enable the X11 windowing system. + enable = true; + # Remove/disable xterm, we are using Konsole. + desktopManager.xterm.enable = false; + excludePackages = with pkgs; [ xterm ]; + + # Enable the SDDM display manager + displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # libinput.enable = true; + }; # Enable the KDE Plasma Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.displayManager.sddm.wayland.enable = true; services.desktopManager.plasma6.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ elisa ]; # GTK themes are not applied in Wayland applications / Window Decorations missing / Cursor looks different programs.dconf.enable = true; @@ -58,33 +68,42 @@ }; # My audio interface has issues after coming out from suspend/hibernate, this will reset it to fix it when necessary. - systemd.services.audiointerface-reset = { - description = "Resets audio interface to clear up any issues"; + + systemd.services.audiointerface-reset-unbind = { + description = "Resets audio interface to clear up any issues - de-initialises audio interface before sleeping/hibernating"; wantedBy = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ]; - after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ]; + before = [ "systemd-suspend.service" "systemd-hibernate.service" "systemd-hybrid-sleep.service" ]; path = with pkgs; [ bash coreutils kmod ]; enable = true; serviceConfig = { User = "root"; Group = "root"; - ExecStart = - let - script = pkgs.writeShellScript "audiointerface-reset" - '' + }; + script = " # Unbind audio interface - echo 3-3 > /sys/bus/usb/drivers/usb/unbind + echo `grep 0a73 /sys/bus/usb/devices/*/idVendor | cut -d '/' -f 6` > /sys/bus/usb/drivers/usb/unbind # Remove snd_usb_audio once no longer in use while ! modprobe -r snd_usb_audio; do - sleep 1 - done - - modprobe snd_usb_audio - # Rebind audio interface - echo 3-3 > /sys/bus/usb/drivers/usb/bind - ''; - in - "${script}"; + sleep 1 + done + "; + }; + systemd.services.audiointerface-reset-bind = { + description = "Resets audio interface to clear up any issues - re-initialises audio interface after sleeping/hibernating"; + wantedBy = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ]; + after = [ "systemd-suspend.service" "systemd-hibernate.service" "systemd-hybrid-sleep.service" ]; + path = with pkgs; [ bash coreutils kmod systemd ]; + enable = true; + serviceConfig = { + User = "root"; + Group = "root"; }; + script = " + systemctl stop audiointerface-reset-unbind.service + modprobe snd_usb_audio + # Rebind audio interface + echo `grep 0a73 /sys/bus/usb/devices/*/idVendor | cut -d '/' -f 6` > /sys/bus/usb/drivers/usb/bind + "; }; # Home Manager Configuration @@ -126,4 +145,12 @@ nvtop-amd ]; + # Set konsole to be default terminal + environment.sessionVariables = { + TERM = "konsole"; + }; + environment.variables = { + TERM = "konsole"; + }; + } diff --git a/configurations/desktop/home.nix b/configurations/desktop/home.nix index 6147a5c0..7015b0fc 100644 --- a/configurations/desktop/home.nix +++ b/configurations/desktop/home.nix @@ -78,6 +78,10 @@ }; }; + home.sessionVariables = { + TERM = "konsole"; + }; + programs.bash.shellAliases = { sudo = "sudo "; doas = "doas "; diff --git a/global-home.nix b/global-home.nix index a3700ad7..90befa9e 100644 --- a/global-home.nix +++ b/global-home.nix @@ -57,6 +57,7 @@ in lsp-plugins yabridge yabridgectl + MIDIVisualizer kdenlive vlc @@ -106,7 +107,7 @@ in Categories=Other; Icon=konsole Type=Application - Exec=konsole -e ncmpcpp + Exec=$TERM -e ncmpcpp Terminal=false ''; }; diff --git a/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/prepare/begin/start.sh b/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/prepare/begin/start.sh index 0e2ee937..dac34249 100755 --- a/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/prepare/begin/start.sh +++ b/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/prepare/begin/start.sh @@ -13,7 +13,7 @@ loginctl terminate-session $session # My audio interface has issues after coming out from a suspended type state, this will reset it to fix it when necessary. # Unbind audio interface -echo 3-3 > /sys/bus/usb/drivers/usb/unbind +echo `grep 0a73 /sys/bus/usb/devices/*/idVendor | cut -d '/' -f 6` > /sys/bus/usb/drivers/usb/unbind # Remove snd_usb_audio once no longer in use while ! modprobe -r snd_usb_audio; do sleep 1 diff --git a/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/release/end/revert.sh b/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/release/end/revert.sh index 35310dc3..fa5e9139 100755 --- a/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/release/end/revert.sh +++ b/modules/cspark-single-gpu-passthru/resources/libvirt/hooks/qemu.d/vm/release/end/revert.sh @@ -3,7 +3,7 @@ set -x # My audio interface has issues after coming out from a suspended type state, this will reset it to fix it when necessary. modprobe snd_usb_audio # Rebind audio interface -echo 3-3 > /sys/bus/usb/drivers/usb/bind +echo `grep 0a73 /sys/bus/usb/devices/*/idVendor | cut -d '/' -f 6` > /sys/bus/usb/drivers/usb/bind # Remove vfio modules modprobe -r vfio_pci