111 lines
2.6 KiB
Nix
111 lines
2.6 KiB
Nix
{ 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";
|
|
};
|
|
installGaming = lib.mkOption {
|
|
default = false;
|
|
example = true;
|
|
description = "Whether to install gaming software on the system.";
|
|
};
|
|
systemPackages = lib.mkOption {
|
|
default = [];
|
|
description = "Add any additional packages desired. Merged with sway defaults.";
|
|
};
|
|
|
|
};
|
|
|
|
###
|
|
## Configuration
|
|
###
|
|
|
|
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
|
|
###
|
|
environment.systemPackages = with pkgs; lib.lists.flatten [
|
|
[
|
|
bash
|
|
foot
|
|
git
|
|
glib # gsettings
|
|
grim
|
|
libnotify
|
|
mako
|
|
ncspot
|
|
networkmanagerapplet
|
|
pavucontrol
|
|
slurp
|
|
swaylock
|
|
swayidle
|
|
wl-clipboard
|
|
xdg-utils
|
|
zsh
|
|
# Fonts
|
|
|
|
]
|
|
config.swaywm.systemPackages
|
|
# (lib.mkIf config.swaywm.installGaming [
|
|
# pkgs.lutris
|
|
# ])
|
|
];
|
|
|
|
programs.zsh.enable = true;
|
|
programs.steam.enable = config.swaywm.installGaming;
|
|
|
|
###
|
|
## Services
|
|
###
|
|
services.openssh.enable = true;
|
|
services.dbus.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
# kdeconnect setup
|
|
programs.kdeconnect.enable = true;
|
|
|
|
###
|
|
## Misc
|
|
###
|
|
sound.enable = true;
|
|
# Necessary for home-manager sway setup
|
|
security.polkit.enable = true;
|
|
|
|
hardware.opengl = {
|
|
enable = true;
|
|
driSupport = true;
|
|
};
|
|
|
|
};
|
|
}
|