Add Niri, a scrolling tiling window manager.

This commit is contained in:
Jimbo 2024-12-03 16:50:23 -05:00
parent 325c176464
commit b3d9d2f396
38 changed files with 758 additions and 376 deletions

View file

@ -3,12 +3,12 @@
imports = [
./backlights
./dconf
./desktops
./gaming
./git
./greetd
./nh
./qt
./security
./shells
./sway
];
}

View file

@ -0,0 +1,11 @@
{ config, lib, ... }:
{
programs = {
sway.enable = config.system.desktop.enable;
niri.enable = config.system.desktop.enable;
xwayland.enable = lib.mkForce config.system.desktop.enable;
};
services.dbus.enable = config.system.desktop.enable;
security.pam.services.swaylock = {};
}

View file

@ -1,22 +1,6 @@
{ config, pkgs, ... }:
{
# Configure greetd for login directly to Sway
services.greetd = let
startSway = pkgs.writeScript "startsway" ''
if ${pkgs.pciutils}/bin/lspci -k | grep "in use: nvidia" &> /dev/null; then
export LIBVA_DRIVER_NAME=nvidia
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
else
:
fi
export XDG_CURRENT_DESKTOP=sway
export QT_QPA_PLATFORM="wayland;xcb"
sway --unsupported-gpu
'';
in {
services.greetd = {
enable = config.system.desktop.enable;
restart = true;
settings = {
@ -24,10 +8,32 @@
vt = 2;
switch = true;
};
default_session = {
command = "${startSway}";
user = "jimbo";
};
default_session.command = "${pkgs.cage}/bin/cage -d -m last ${pkgs.greetd.gtkgreet}/bin/gtkgreet";
};
};
environment.etc."greetd/environments".text = let
initScript = ''
if ${pkgs.pciutils}/bin/lspci -k | grep "in use: nvidia" &> /dev/null; then
export LIBVA_DRIVER_NAME=nvidia
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
else
:
fi
'';
in ''
${pkgs.writeScript "startsway" ''
${initScript}
export QT_QPA_PLATFORM="wayland;xcb"
export XDG_CURRENT_DESKTOP=sway
sway --unsupported-gpu
''}
${pkgs.writeScript "startniri" ''
${initScript}
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=niri
niri-session
''}
'';
}

View file

@ -1,8 +0,0 @@
{ config, ... }:
{
qt = {
enable = config.system.desktop.enable;
style = "gtk2";
platformTheme = "gtk2";
};
}

View file

@ -1,12 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ./greetd ];
programs.sway = {
enable = config.system.desktop.enable;
extraPackages = with pkgs; [ swaylock ];
};
services.dbus.enable = config.system.desktop.enable;
security.pam.services.swaylock = {};
}

View file

@ -1,11 +1,14 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
{
xdg.portal.wlr = {
enable = config.system.desktop.enable;
settings.screencast = {
max_fps = 60;
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
xdg.portal = {
wlr = {
enable = lib.mkForce config.system.desktop.enable;
settings.screencast = {
max_fps = 60;
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
};
};
extraPortals = with pkgs; [ xdg-desktop-portal-gnome ];
};
}