From 32c943e19323b7be2a15aa18d575e03074a7e6c4 Mon Sep 17 00:00:00 2001 From: "c0co.channel" Date: Wed, 10 Sep 2025 01:32:17 +0100 Subject: Tidy .scms, more XDG env vars, virtman to syswide --- dom0/files/misc-config/sway-config | 4 ++-- dom0/home.scm | 31 +++++++++++++++++++++++-------- dom0/system-laptop.scm | 16 ++++++++-------- dom0/system.scm | 1 + 4 files changed, 34 insertions(+), 18 deletions(-) (limited to 'dom0') diff --git a/dom0/files/misc-config/sway-config b/dom0/files/misc-config/sway-config index e654cea..fd4e37f 100644 --- a/dom0/files/misc-config/sway-config +++ b/dom0/files/misc-config/sway-config @@ -26,7 +26,7 @@ output * bg $HOME/.config/guix-config/dom0/files/wallpapers/taclnc.png fill # Example configuration: # # output HDMI-A-1 resolution 1920x1080 position 1920,0 -output * resolution 1920x1080 position 1920,0 +output * resolution 1920x1080 exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY exec spice-vdagent # You can get the names of your outputs by running: swaymsg -t get_outputs @@ -222,7 +222,7 @@ bar { # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. - status_command while date +'%Y-%m-%d %X'; do sleep 1; done + status_command while (echo "!! WARNING !! THIS IS Dom0 !! $(date +'%Y-%m-%d %X'); do sleep 1; done colors { statusline #ffffff diff --git a/dom0/home.scm b/dom0/home.scm index ee1028d..16bec95 100644 --- a/dom0/home.scm +++ b/dom0/home.scm @@ -13,10 +13,10 @@ #:use-module (guix gexp) #:export (dom0-home-environment)) - (use-package-modules compression gnome fonts freedesktop + (use-package-modules compression gnome gnome-xyz video fonts freedesktop linux package-management pulseaudio ssh terminals xdisorg xorg glib virtualization - wm) + wm messaging) (define dom0-home-environment (home-environment @@ -40,12 +40,24 @@ ("CLUTTER_BACKEND" . "wayland") ("ELM_ENGINE" . "wayland_egl") ("ECORE_EVAS_ENGINE" . "wayland-egl") - ("QT_QPA_PLATFORM" . "wayland-egl"))) + ("QT_QPA_PLATFORM" . "wayland-egl") + + ;; JAVA + ("_JAVA_AWT_WM_NONREPARENTING" . #t) + + ;; env-vars for Flatpak visibility + ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"))) (service home-bash-service-type (home-bash-configuration - (bash-profile (list (local-file "files/scripts/sway-login"))) + (bash-profile (list (local-file "files/scripts/sway-login") + ("flatpak -u remote-add --if-not-exists flathub https://flathub.org/repo/flathub.pakrepo")) (bashrc (list (local-file "files/scripts/gpg-agent-tty"))))) + + (simple-service 'xdg-user-directories-config-service + home-xdg-user-directories-service-type + (home-xdg-user-directories-configuration + (download "$HOME/Downloads"))) (service home-xdg-configuration-files-service-type `(("sway/config" ,(local-file "./files/misc-config/sway-config")))) @@ -55,20 +67,23 @@ (pinentry-program (file-append pinentry "/bin/pinentry")) (ssh-support? #t))) + (service home-dbus-service-type) (service home-pipewire-service-type))) (packages (list xorg-server-xwayland sway swayidle swaylock fuzzel foot - grimshot wl-clipboard network-manager-applet + grimshot wl-clipboard wl-paste network-manager-applet xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-utils xdg-dbus-proxy shared-mime-info - ;; Flatpak - flatpak (list glib "bin") + ;; Flatpak and XDG + flatpak (list glib "bin") ; flatpak dependency + xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr + xdg-utils xdg-dbus-proxy shared-mime-info ;; Audio alsa-utils pavucontrol ;; General - virt-manager openssh zip unzip)))) + openssh zip unzip)))) diff --git a/dom0/system-laptop.scm b/dom0/system-laptop.scm index d7f9ba5..20bdc89 100644 --- a/dom0/system-laptop.scm +++ b/dom0/system-laptop.scm @@ -26,13 +26,13 @@ ;; Users ('root' is implicit). (users (cons* (user-account - (name "dom0") - (comment "dom0") - (group "users") - (home-directory "/home/dom0") - (supplementary-groups '("wheel" "libvirt" "kvm" + (name "dom0") + (comment "dom0") + (group "users") + (home-directory "/home/dom0") + (supplementary-groups '("wheel" "libvirt" "kvm" "netdev" "audio" "video"))) - %base-user-accounts)) + %base-user-accounts)) (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) @@ -94,8 +94,7 @@ (list ;; NVIDIA (service nvidia-service-type) - ;(service kernel-module-loader-service-type - ;'("nvidia")) + ;; systemd dependencies (service elogind-service-type) @@ -171,5 +170,6 @@ (packages (cons* vim git cryptsetup + virt-manager strace %base-packages))) diff --git a/dom0/system.scm b/dom0/system.scm index 4b5b03c..6cd02c5 100644 --- a/dom0/system.scm +++ b/dom0/system.scm @@ -170,6 +170,7 @@ ;; Packages (system-wide) (packages (cons* vim git + virt-manager cryptsetup strace %base-packages))) -- cgit v1.2.3 From cd080424127bb8e91ba4df7f36aa7b541d35752b Mon Sep 17 00:00:00 2001 From: "c0co.channel" Date: Wed, 10 Sep 2025 17:50:26 +0100 Subject: Rework for dekstop and nvidia display src --- dom0/files/misc-config/sway-config | 4 +- dom0/files/scripts/sway-login | 2 +- dom0/files/scripts/sway-login-laptop | 3 ++ dom0/home-laptop.scm | 89 ++++++++++++++++++++++++++++++++++++ dom0/home.scm | 33 ++++++------- dom0/system.scm | 14 +++--- 6 files changed, 119 insertions(+), 26 deletions(-) create mode 100644 dom0/files/scripts/sway-login-laptop create mode 100644 dom0/home-laptop.scm (limited to 'dom0') diff --git a/dom0/files/misc-config/sway-config b/dom0/files/misc-config/sway-config index fd4e37f..60e6eed 100644 --- a/dom0/files/misc-config/sway-config +++ b/dom0/files/misc-config/sway-config @@ -28,7 +28,7 @@ output * bg $HOME/.config/guix-config/dom0/files/wallpapers/taclnc.png fill # output HDMI-A-1 resolution 1920x1080 position 1920,0 output * resolution 1920x1080 exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY -exec spice-vdagent +# exec spice-vdagent # You can get the names of your outputs by running: swaymsg -t get_outputs ### Idle configuration @@ -222,7 +222,7 @@ bar { # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. - status_command while (echo "!! WARNING !! THIS IS Dom0 !! $(date +'%Y-%m-%d %X'); do sleep 1; done + status_command while (echo "! ! WARNING ! ! THIS IS Dom0 ! ! $(date +'%Y-%m-%d %X')"); do sleep 1; done colors { statusline #ffffff diff --git a/dom0/files/scripts/sway-login b/dom0/files/scripts/sway-login index 3792a85..2711786 100644 --- a/dom0/files/scripts/sway-login +++ b/dom0/files/scripts/sway-login @@ -1,3 +1,3 @@ if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then - exec sway; + exec sway --unsupported-gpu; fi diff --git a/dom0/files/scripts/sway-login-laptop b/dom0/files/scripts/sway-login-laptop new file mode 100644 index 0000000..3792a85 --- /dev/null +++ b/dom0/files/scripts/sway-login-laptop @@ -0,0 +1,3 @@ +if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then + exec sway; +fi diff --git a/dom0/home-laptop.scm b/dom0/home-laptop.scm new file mode 100644 index 0000000..f1146b7 --- /dev/null +++ b/dom0/home-laptop.scm @@ -0,0 +1,89 @@ +(define-module (dom0 home) + #:use-module (gnu) + #:use-module (gnu packages gnupg) + #:use-module (gnu services) + #:use-module (gnu home) + #:use-module (gnu home services) + #:use-module (gnu home services pm) + #:use-module (gnu home services sound) + #:use-module (gnu home services shells) + #:use-module (gnu home services desktop) + #:use-module (gnu home services gnupg) + #:use-module (gnu home services xdg) + #:use-module (guix gexp) + #:export (dom0-home-environment)) + + (use-package-modules compression gnome gnome-xyz video fonts freedesktop + linux package-management pulseaudio ssh + terminals xdisorg xorg glib virtualization + wm messaging) + + (define dom0-home-environment + (home-environment + (services + (list + (simple-service 'profile-env-vars-service + home-environment-variables-service-type + '(;; Sort dot files first in ls + ("LC_COLLATE" . "C") + + ;; vim instead of nano + ("VISUAL" . "vim") + ("EDITOR" . "vim") + + ;; Wayland + ("XDG_CURRENT_DESKTOP" . "sway") + ("XDG_SESSION_TYPE" . "wayland") + ("RTC_USE_PIPEWIRE" . "true") + ("SDL_VIDEODRIVER" . "wayland") + ("MOZ_ENABLE_WAYLAND" . "1") + ("CLUTTER_BACKEND" . "wayland") + ("ELM_ENGINE" . "wayland_egl") + ("ECORE_EVAS_ENGINE" . "wayland-egl") + ("QT_QPA_PLATFORM" . "wayland-egl") + + ;; JAVA + ("_JAVA_AWT_WM_NONREPARENTING" . #t) + + ;; env-vars for Flatpak visibility + ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"))) + + (service home-bash-service-type + (home-bash-configuration + (bash-profile (list (local-file "files/scripts/sway-login") + (plain-file "bash-profile" "flatpak -u remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo"))) + (bashrc (list (local-file "files/scripts/gpg-agent-tty"))))) + + (simple-service 'xdg-user-directories-config-service + home-xdg-user-directories-service-type + (home-xdg-user-directories-configuration + (download "$HOME/Downloads"))) + + (service home-xdg-configuration-files-service-type + `(("sway/config" ,(local-file "./files/misc-config/sway-config")))) + + (service home-gpg-agent-service-type + (home-gpg-agent-configuration + (pinentry-program + (file-append pinentry "/bin/pinentry")) + (ssh-support? #t))) + + (service home-dbus-service-type) + (service home-pipewire-service-type))) + + (packages (list xorg-server-xwayland + sway swayidle swaylock fuzzel foot + grimshot wl-clipboard network-manager-applet + xdg-desktop-portal xdg-desktop-portal-gtk + xdg-desktop-portal-wlr xdg-utils xdg-dbus-proxy shared-mime-info + + ;; Flatpak and XDG + flatpak (list glib "bin") ; flatpak dependency + xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr + xdg-utils xdg-dbus-proxy shared-mime-info + + ;; Audio + alsa-utils pavucontrol + + ;; General + openssh zip unzip)))) diff --git a/dom0/home.scm b/dom0/home.scm index 16bec95..0b76b53 100644 --- a/dom0/home.scm +++ b/dom0/home.scm @@ -10,6 +10,7 @@ #:use-module (gnu home services desktop) #:use-module (gnu home services gnupg) #:use-module (gnu home services xdg) + #:use-module (nongnu packages nvidia) #:use-module (guix gexp) #:export (dom0-home-environment)) @@ -51,7 +52,7 @@ (service home-bash-service-type (home-bash-configuration (bash-profile (list (local-file "files/scripts/sway-login") - ("flatpak -u remote-add --if-not-exists flathub https://flathub.org/repo/flathub.pakrepo")) + (plain-file "bash-profile" "flatpak -u remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo"))) (bashrc (list (local-file "files/scripts/gpg-agent-tty"))))) (simple-service 'xdg-user-directories-config-service @@ -71,19 +72,19 @@ (service home-dbus-service-type) (service home-pipewire-service-type))) - (packages (list xorg-server-xwayland - sway swayidle swaylock fuzzel foot - grimshot wl-clipboard wl-paste network-manager-applet - xdg-desktop-portal xdg-desktop-portal-gtk - xdg-desktop-portal-wlr xdg-utils xdg-dbus-proxy shared-mime-info - - ;; Flatpak and XDG - flatpak (list glib "bin") ; flatpak dependency - xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr - xdg-utils xdg-dbus-proxy shared-mime-info + (packages (append (map replace-mesa (list flatpak sway)) + (list xorg-server-xwayland + swayidle swaylock fuzzel foot + grimshot wl-clipboard network-manager-applet - ;; Audio - alsa-utils pavucontrol - - ;; General - openssh zip unzip)))) + ;; XDG and Flatpak dependency + (list glib "bin") + xdg-desktop-portal xdg-desktop-portal-gtk + xdg-desktop-portal-wlr xdg-utils xdg-dbus-proxy + shared-mime-info + + ;; Audio + alsa-utils pavucontrol + + ;; General + openssh zip unzip))))) diff --git a/dom0/system.scm b/dom0/system.scm index 6cd02c5..72039a1 100644 --- a/dom0/system.scm +++ b/dom0/system.scm @@ -42,11 +42,11 @@ ;; replace post-install (swap-devices (list (swap-space (target (uuid - "7a22a333-6a5d-41fe-93a2-e5781031cfd6"))))) + "c7e7ee28-23ba-4ec1-b206-19a4e6297083"))))) ;; luks setup - uncomment post-install ;; and provide source UUID once known (mapped-devices (list (mapped-device - (source (uuid "0c5d284e-e0c7-4dc3-bbca-f82ee6bb82e3")) + (source (uuid "61e732e5-97ca-41d8-a1cf-3672eb97e6f8")) (target "system-root") (type luks-device-mapping)))) @@ -56,7 +56,7 @@ ;; Will change after install (file-systems (cons* (file-system (mount-point "/boot/efi") - (device (uuid "6919-B0C9" + (device (uuid "3BC7-90B1" 'fat32)) (type "vfat")) (file-system @@ -94,8 +94,7 @@ (list ;; NVIDIA (service nvidia-service-type) - ;(service kernel-module-loader-service-type - ;'("nvidia")) + ;; systemd dependencies (service elogind-service-type) @@ -157,7 +156,8 @@ ;; Virtualization (service libvirt-service-type (libvirt-configuration - (libvirt (patch-libvirt libvirt)))) + (libvirt (patch-libvirt libvirt)) + (qemu (replace-mesa qemu)))) (service virtlog-service-type) ;; udev @@ -170,7 +170,7 @@ ;; Packages (system-wide) (packages (cons* vim git - virt-manager + (replace-mesa virt-manager) cryptsetup strace %base-packages))) -- cgit v1.2.3