2023-12-15 15:50:45 -07:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
options.swaywm = {
|
|
|
|
enable = lib.mkEnableOption "Enable sway window manager.";
|
|
|
|
useNonFree = lib.mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Whether to enable non-free software in the sway config";
|
|
|
|
};
|
2023-12-16 16:36:03 -07:00
|
|
|
installGaming = lib.mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Whether to install gaming software on the system.";
|
|
|
|
};
|
2023-12-15 15:50:45 -07:00
|
|
|
systemPackages = lib.mkOption {
|
|
|
|
default = [];
|
|
|
|
description = "Add any additional packages desired. Merged with sway defaults.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf config.swaywm.enable {
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = config.swaywm.useNonFree;
|
|
|
|
|
|
|
|
###
|
|
|
|
## XDG portal setup
|
|
|
|
###
|
|
|
|
xdg.portal = {
|
|
|
|
config = {
|
|
|
|
common = {
|
|
|
|
default = [
|
|
|
|
"wlr"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraPortals = with pkgs; [
|
|
|
|
# xdg-desktop-portal-kde
|
|
|
|
xdg-desktop-portal-gtk
|
|
|
|
];
|
|
|
|
wlr.enable = true;
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
xdg.sounds.enable = true;
|
|
|
|
|
|
|
|
###
|
|
|
|
## System Packages
|
|
|
|
###
|
2023-12-16 16:36:03 -07:00
|
|
|
environment.systemPackages = with pkgs; lib.lists.flatten [
|
|
|
|
[
|
2023-12-15 15:50:45 -07:00
|
|
|
git
|
|
|
|
glib # gsettings
|
|
|
|
grim
|
|
|
|
pavucontrol
|
|
|
|
slurp
|
|
|
|
swaylock
|
|
|
|
swayidle
|
|
|
|
wl-clipboard
|
|
|
|
xdg-utils
|
|
|
|
zsh
|
2023-12-16 16:36:03 -07:00
|
|
|
# Add to gaming only installs
|
|
|
|
lutris
|
|
|
|
wine-wayland
|
|
|
|
# Video utils
|
|
|
|
davinci-resolve-studio
|
|
|
|
imv
|
|
|
|
mpv
|
|
|
|
gimp
|
|
|
|
]
|
2023-12-15 15:50:45 -07:00
|
|
|
config.swaywm.systemPackages
|
2023-12-16 16:36:03 -07:00
|
|
|
# (lib.mkIf config.swaywm.installGaming [
|
|
|
|
# pkgs.lutris
|
|
|
|
# ])
|
2023-12-15 15:50:45 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.zsh.enable = true;
|
2023-12-16 16:36:03 -07:00
|
|
|
programs.steam.enable = config.swaywm.installGaming;
|
2023-12-15 15:50:45 -07:00
|
|
|
|
|
|
|
###
|
|
|
|
## Services
|
|
|
|
###
|
|
|
|
services.openssh.enable = true;
|
|
|
|
services.dbus.enable = true;
|
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa.enable = true;
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
|
|
|
|
2023-12-16 16:36:03 -07:00
|
|
|
# kdeconnect setup
|
|
|
|
programs.kdeconnect.enable = true;
|
|
|
|
|
2023-12-15 15:50:45 -07:00
|
|
|
# Firewall
|
2023-12-16 16:36:03 -07:00
|
|
|
# networking.firewall = {
|
|
|
|
# enable = true;
|
|
|
|
# allowedTCPPortRanges = [
|
|
|
|
# {from = 1714; to = 1764;} # KDE Connnect
|
|
|
|
# ];
|
|
|
|
# allowedUDPPortRanges = [
|
|
|
|
# {from = 1714; to = 1764;} # KDE Connnect
|
|
|
|
# ];
|
|
|
|
# };
|
2023-12-15 15:50:45 -07:00
|
|
|
|
|
|
|
###
|
|
|
|
## Misc
|
|
|
|
###
|
|
|
|
sound.enable = true;
|
|
|
|
# Necessary for home-manager sway setup
|
|
|
|
security.polkit.enable = true;
|
|
|
|
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|