nixos/nate/modules/sway/sway_conf.nix

195 lines
5.6 KiB
Nix

{ lib, config, pkgs, userName, ... }:
{
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 {
programs.sway.enable = true;
nixpkgs.config.allowUnfree = config.swaywm.useNonFree;
# For R2ModMan
# nixpkgs.config.permittedInsecurePackages = [
# "electron-25.9.0"
# ];
###
## 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
sway-contrib.grimshot
libnotify
mako
ncspot
networkmanagerapplet
pavucontrol
slurp
syncthingtray
swaylock
swayidle
swww
tailscale-systray
wl-clipboard
waybar
wdisplays
wofi
xdg-utils
zsh
lxqt.lxqt-policykit
# Fonts
]
config.swaywm.systemPackages
# (lib.mkIf config.swaywm.installGaming [
# pkgs.lutris
# ])
];
environment.variables.QT_STYLE_OVERRIDE = "kvantum";
# environment.loginShellInit = ''
# [[ "$(tty)" == /dev/tty1 ]] && sway
# '';
# Thunar config
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
programs.file-roller.enable = true;
programs.xfconf.enable = true;
programs.zsh.enable = true;
programs.steam.enable = config.swaywm.installGaming;
programs.gamemode.enable = true;
programs.adb.enable = true;
# kdeconnect setup
programs.kdeconnect.enable = true;
# service file to start the sshAgent
programs.ssh.startAgent = true;
###
## Services
###
virtualisation.docker.enable = true;
services.gvfs.enable = true; # thunar mount, trash, etc
services.tumbler.enable = true; # thunar thumbnails
services.openssh.enable = true;
services.dbus.enable = true;
services.syncthing.enable = true;
services.tailscale = {
enable = true;
openFirewall = true;
};
# For betaflight configurator
services.udev.extraRules = ''
# DFU (Internal bootloader for STM32 and AT32 MCUs)
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
'';
# For yubioath desktop
services.pcscd.enable = true;
# Audio
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
# alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
sound.enable = false;
###
## Misc
###
# Necessary for home-manager sway setup
security.polkit.enable = true;
# services.xserver.enable = true;
# services.xserver.displayManager.defaultSession = "sway";
# services.xserver.displayManager.gdm.enable = true;
# services.xserver.displayManager.gdm.wayland = true;
# services.xserver.displayManager.gdm.settings = {
# greeter.includeAll = false;
# greeter.include = "nate";
# };
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "${pkgs.sway}/bin/sway";
user = "nate";
};
default_session = initial_session;
};
};
services.xserver.videoDrivers = [ "amdgpu" ];
# Enable HIP
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
# services.xserver.videoDrivers = [ "amdgpu-pro" ];
hardware.opengl = {
# Mesa
enable = true;
# Vulkan
driSupport = true;
# Rocm support and vulkan drivers
extraPackages = with pkgs; [
rocmPackages.clr.icd
amdvlk
];
};
};
}