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.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2023-12-18 20:12:41 -07:00
|
|
|
###
|
|
|
|
## Configuration
|
|
|
|
###
|
2023-12-15 15:50:45 -07:00
|
|
|
config = lib.mkIf config.swaywm.enable {
|
|
|
|
|
2024-01-12 16:18:45 -07:00
|
|
|
programs.sway.enable = true;
|
|
|
|
|
2023-12-15 15:50:45 -07:00
|
|
|
nixpkgs.config.allowUnfree = config.swaywm.useNonFree;
|
2023-12-30 21:39:49 -07:00
|
|
|
# For R2ModMan
|
2024-01-12 16:18:45 -07:00
|
|
|
# nixpkgs.config.permittedInsecurePackages = [
|
|
|
|
# "electron-25.9.0"
|
|
|
|
# ];
|
2023-12-15 15:50:45 -07:00
|
|
|
|
|
|
|
###
|
|
|
|
## 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-18 20:12:41 -07:00
|
|
|
bash
|
|
|
|
foot
|
2023-12-15 15:50:45 -07:00
|
|
|
git
|
|
|
|
glib # gsettings
|
|
|
|
grim
|
2024-01-20 13:34:45 -07:00
|
|
|
sway-contrib.grimshot
|
2023-12-18 20:12:41 -07:00
|
|
|
libnotify
|
|
|
|
mako
|
|
|
|
ncspot
|
|
|
|
networkmanagerapplet
|
2023-12-15 15:50:45 -07:00
|
|
|
pavucontrol
|
|
|
|
slurp
|
|
|
|
swaylock
|
|
|
|
swayidle
|
2024-01-15 22:07:47 -07:00
|
|
|
swww
|
2023-12-15 15:50:45 -07:00
|
|
|
wl-clipboard
|
2024-01-12 16:18:45 -07:00
|
|
|
waybar
|
2024-01-07 22:18:36 -07:00
|
|
|
wdisplays
|
2024-01-12 16:18:45 -07:00
|
|
|
wofi
|
2023-12-15 15:50:45 -07:00
|
|
|
xdg-utils
|
|
|
|
zsh
|
2023-12-18 20:12:41 -07:00
|
|
|
# Fonts
|
2023-12-16 16:36:03 -07:00
|
|
|
]
|
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
|
|
|
];
|
|
|
|
|
2024-01-15 22:07:47 -07:00
|
|
|
environment.loginShellInit = ''
|
|
|
|
[[ "$(tty)" == /dev/tty1 ]] && sway
|
|
|
|
'';
|
2024-01-07 22:18:36 -07:00
|
|
|
# Thunar config
|
|
|
|
programs.thunar = {
|
|
|
|
enable = true;
|
|
|
|
plugins = with pkgs.xfce; [
|
|
|
|
thunar-archive-plugin
|
|
|
|
thunar-volman
|
|
|
|
];
|
|
|
|
};
|
|
|
|
programs.file-roller.enable = true;
|
|
|
|
programs.xfconf.enable = true;
|
|
|
|
|
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
|
|
|
|
2024-01-12 16:18:45 -07:00
|
|
|
programs.adb.enable = true;
|
|
|
|
# kdeconnect setup
|
|
|
|
programs.kdeconnect.enable = true;
|
2024-01-07 22:18:36 -07:00
|
|
|
|
2023-12-15 15:50:45 -07:00
|
|
|
###
|
|
|
|
## Services
|
|
|
|
###
|
2024-01-07 22:18:36 -07:00
|
|
|
services.gvfs.enable = true; # thunar functionalities
|
2023-12-15 15:50:45 -07:00
|
|
|
services.openssh.enable = true;
|
|
|
|
services.dbus.enable = true;
|
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa.enable = true;
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
###
|
|
|
|
## Misc
|
|
|
|
###
|
|
|
|
sound.enable = true;
|
|
|
|
# Necessary for home-manager sway setup
|
|
|
|
security.polkit.enable = true;
|
|
|
|
|
2024-01-20 11:52:14 -07:00
|
|
|
# Use amdgpu-pro drivers for davinci
|
|
|
|
# services.xserver.videoDrivers = [ "amdgpu-pro" ];
|
2023-12-15 15:50:45 -07:00
|
|
|
hardware.opengl = {
|
2024-01-20 11:52:14 -07:00
|
|
|
# Mesa
|
2024-01-12 16:18:45 -07:00
|
|
|
enable = true;
|
2024-01-20 11:52:14 -07:00
|
|
|
# Vulkan
|
2023-12-15 15:50:45 -07:00
|
|
|
driSupport = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|