replace variant argument with modules
All checks were successful
/ build-all (push) Successful in 1m18s

This commit is contained in:
Antoine Vaure 2025-09-03 16:11:05 +02:00
parent f2608d0a82
commit 1a0086f941
13 changed files with 586 additions and 577 deletions

View file

@ -1,50 +1,4 @@
{ config, lib, pkgs, pkgs-unstable, pkgs-24_05, variant, ... }: {
xdg = lib.attrsets.optionalAttrs (variant == "allegro") {
configFile."systemd/user/dbus-broker.service".source =
"${pkgs.dbus-broker}/share/systemd/user/dbus-broker.service";
configFile."systemd/user/at-spi-dbus-bus.service".source =
"${pkgs.at-spi2-core}/lib/systemd/user/at-spi-dbus-bus.service";
dataFile."dbus-1/services/org.a11y.Bus.service".source =
"${pkgs.at-spi2-core}/share/dbus-1/services/org.a11y.Bus.service";
dataFile."dbus-1/accessibility-services/org.a11y.atspi.Registry.service".source =
"${pkgs.at-spi2-core}/share/dbus-1/accessibility-services/org.a11y.atspi.Registry.service";
configFile."systemd/user/xdg-desktop-portal.service".source =
"${pkgs.xdg-desktop-portal}/lib/systemd/user/xdg-desktop-portal.service";
configFile."systemd/user/xdg-desktop-portal-gtk.service".source =
"${pkgs.xdg-desktop-portal-gtk}/lib/systemd/user/xdg-desktop-portal-gtk.service";
configFile."systemd/user/xdg-desktop-portal-hyprland.service".source =
"${pkgs.xdg-desktop-portal-hyprland}/lib/systemd/user/xdg-desktop-portal-hyprland.service";
dataFile."share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service".source =
"${pkgs.xdg-desktop-portal-hyprland}share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service";
dataFile."systemd/user/pipewire.service".source =
"${pkgs.pipewire}/share/systemd/user/pipewire.service";
dataFile."systemd/user/pipewire-pulse.service".source =
"${pkgs.pipewire}/share/systemd/user/pipewire-pulse.service";
dataFile."systemd/user/filter-chain.service".source =
"${pkgs.pipewire}/share/systemd/user/filter-chain.service";
dataFile."systemd/user/pipewire.socket".source =
"${pkgs.pipewire}/share/systemd/user/pipewire.socket";
dataFile."systemd/user/pipewire-pulse.socket".source =
"${pkgs.pipewire}/share/systemd/user/pipewire-pulse.socket";
portal = {
enable = true;
# xdgOpenUsePortal = true;
extraPortals =
[ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
configPackages =
[ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
# config.common.default = "*";
config = {
hyprland = { default = [ "gtk,hyprland" ]; };
common = { default = [ "gtk,hyprland" ]; };
};
};
};
{ config, lib, pkgs, ... }: {
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland,x11";
@ -342,57 +296,8 @@
# -p pkgs.rubyPackages.gdk_pixbuf2 \
# --run "${pkgs.swaybg}/bin/swaybg -m fill -i $bg"
'');
monitors = if (variant == "default") then ''
monitor=,highrr,auto,1
''
else if variant == "moon" then ''
monitor=,preferred,auto,1
monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
''
else if variant == "allegro" then ''
monitor= DP-4, 1920x1200@75, 3840x0, 1
monitor= DP-3, 1920x1200@75, 1920x0, 1
monitor=eDP-1, 1920x1080, 0x0, 1
monitor=HDMI-1, 3440x1440, auto, 1
monitor=HDMI-A-1, 3440x1440, auto, 1
# monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
# monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
''
else ''
'';
in
''
${monitors}
${ # system specific configs
if variant == "default" then ''
#env = GBM_BACKEND,nvidia-drm
#env = __GLX_VENDOR_LIBRARY_NAME,nvidia
# env = WLR_DRM_DEVICES,/dev/dri/card1
# env = AQ_WLR_DEVICES,/dev/dri/card1
# env = AQ_DRM_DEVICES,/dev/dri/card1
''
else if variant == "allegro" then ''
env = WLR_DRM_DEVICES,/dev/dri/card0
env = AQ_WLR_DEVICES,/dev/dri/card0
env = AQ_DRM_DEVICES,/dev/dri/card0
env = TERMINAL,st
env = NIXOS_OZONE_WL,1
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = CLUTTER_BACKEND,wayland
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = WLR_NO_HARDWARE_CURSORS,1
env = XCURSOR_SIZE,24
'' else ''
''
}
env = HYPRCURSOR_THEME,Hackneyed
env = HYPRCURSOR_SIZE,24
@ -425,7 +330,7 @@
bind = ,s, exec, systemctl suspend
bind = ,s, submap, reset
bind = SHIFT,S,exec, ${if variant == "allegro" then "/usr/sbin/shutdown" else "shutdown"} now
bind = SHIFT,S,exec, shutdown now
bind = ,S, submap, reset
bind = ,h, exec, systemctl hibernate
@ -434,7 +339,7 @@
bind = ,e, exit
bind = ,e, submap, reset
bind = ,r, exec, ${if variant == "allegro" then "/usr/sbin/reboot" else "reboot"}
bind = ,r, exec, reboot
bind = ,r, submap, reset
bind = ,l, exec, swaylock