Begin the move to the import all, activate by config model
This commit is contained in:
parent
7397b614de
commit
07cb2d67a2
97 changed files with 776 additions and 633 deletions
16
modules/system/programs/sway/default.nix
Normal file
16
modules/system/programs/sway/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./greetd
|
||||
./portals
|
||||
];
|
||||
|
||||
programs.sway = {
|
||||
enable = config.system.desktop.enable;
|
||||
package = pkgs.unstable.sway;
|
||||
extraPackages = with pkgs; [ swaylock ];
|
||||
};
|
||||
|
||||
services.dbus.enable = config.system.desktop.enable;
|
||||
security.pam.services.swaylock = {};
|
||||
}
|
33
modules/system/programs/sway/greetd/default.nix
Normal file
33
modules/system/programs/sway/greetd/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ 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 {
|
||||
enable = config.system.desktop.enable;
|
||||
restart = true;
|
||||
settings = {
|
||||
terminal = {
|
||||
vt = 2;
|
||||
switch = true;
|
||||
};
|
||||
default_session = {
|
||||
command = "${startSway}";
|
||||
user = "jimbo";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
modules/system/programs/sway/portals/default.nix
Normal file
13
modules/system/programs/sway/portals/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue