Sway : Split config.

This commit is contained in:
Dmitry Voronin 2024-03-28 12:01:06 +03:00
parent de18dba4db
commit f3256346e6
5 changed files with 41 additions and 40 deletions

View file

@ -1,7 +1,11 @@
{ pkgs, lib, ... }: { { pkgs, lib, ... }: {
imports = [ imports = [
./desktop/App.nix ./desktop/App.nix
./desktop/Bluetooth.nix
./desktop/Brightness.nix
./desktop/Dconf.nix ./desktop/Dconf.nix
./desktop/Portal.nix
./desktop/Realtime.nix
./desktop/Sound.nix ./desktop/Sound.nix
]; ];
@ -16,7 +20,6 @@
"video/*" = "mpv.desktop"; "video/*" = "mpv.desktop";
}; };
# Extra apps.
services.gnome.gnome-keyring.enable = lib.mkForce false; services.gnome.gnome-keyring.enable = lib.mkForce false;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
grim # Screenshot. grim # Screenshot.
@ -29,7 +32,6 @@
wl-clipboard # Clipboard. wl-clipboard # Clipboard.
]; ];
# Sway.
programs.sway = { programs.sway = {
enable = true; enable = true;
wrapperFeatures = { wrapperFeatures = {
@ -41,46 +43,8 @@
]; ];
}; };
# Portals.
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
xdg-desktop-portal-gtk
xdg-desktop-portal-kde
];
config = {
common = {
default = [
"gtk"
"wlr"
"gnome"
"kde"
];
};
};
wlr = {
enable = true;
};
xdgOpenUsePortal = true;
};
# Brightness control.
programs.light.enable = true;
# Bluetooth.
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
# Configs.
environment.variables = { environment.variables = {
FOOT_CONFIG = ./foot/Foot.ini; FOOT_CONFIG = ./foot/Foot.ini;
SWAY_CONFIG = ./sway/module; SWAY_CONFIG = ./sway/module;
}; };
# Extra performance.
security.pam.loginLimits = [
{ domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
];
} }

View file

@ -0,0 +1,5 @@
{ ... }: {
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
}

View file

@ -0,0 +1,3 @@
{ ... }: {
programs.light.enable = true;
}

24
module/desktop/Portal.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs, ... }: {
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
xdg-desktop-portal-gtk
xdg-desktop-portal-kde
];
config = {
common = {
default = [
"gtk"
"wlr"
"gnome"
"kde"
];
};
};
wlr = {
enable = true;
};
xdgOpenUsePortal = true;
};
}

View file

@ -0,0 +1,5 @@
{ ... }: {
security.pam.loginLimits = [
{ domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
];
}