2024-01-27 12:40:09 -07:00
|
|
|
{ lib, config, pkgs, userName, ... }:
|
2023-12-15 15:50:45 -07:00
|
|
|
{
|
|
|
|
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;
|
2024-07-22 13:30:55 -06:00
|
|
|
programs.sway.wrapperFeatures.gtk = true;
|
2024-01-12 16:18:45 -07:00
|
|
|
|
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
|
2024-07-22 13:30:55 -06:00
|
|
|
man-pages
|
|
|
|
man-pages-posix
|
2023-12-18 20:12:41 -07:00
|
|
|
ncspot
|
|
|
|
networkmanagerapplet
|
2023-12-15 15:50:45 -07:00
|
|
|
pavucontrol
|
|
|
|
slurp
|
2024-03-18 19:45:31 -06:00
|
|
|
syncthingtray
|
2023-12-15 15:50:45 -07:00
|
|
|
swaylock
|
|
|
|
swayidle
|
2024-09-02 14:45:05 -06:00
|
|
|
swaybg
|
|
|
|
# swww
|
2024-05-15 10:17:27 -06:00
|
|
|
tailscale-systray
|
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
|
2024-03-17 20:24:39 -06:00
|
|
|
lxqt.lxqt-policykit
|
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
|
|
|
|
];
|
2024-03-18 19:45:31 -06:00
|
|
|
environment.variables.QT_STYLE_OVERRIDE = "kvantum";
|
2023-12-15 15:50:45 -07:00
|
|
|
|
2024-07-22 13:30:55 -06:00
|
|
|
# adds additional man pages
|
|
|
|
documentation.dev.enable = true;
|
2024-01-27 12:40:09 -07:00
|
|
|
|
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;
|
2024-02-15 11:22:47 -07:00
|
|
|
programs.gamemode.enable = true;
|
2023-12-15 15:50:45 -07:00
|
|
|
|
2024-01-12 16:18:45 -07:00
|
|
|
programs.adb.enable = true;
|
2024-11-08 08:52:19 -07:00
|
|
|
# programs.kdeconnect.enable = true;
|
2024-03-20 15:00:06 -06:00
|
|
|
# service file to start the sshAgent
|
|
|
|
programs.ssh.startAgent = true;
|
2024-01-07 22:18:36 -07:00
|
|
|
|
2023-12-15 15:50:45 -07:00
|
|
|
###
|
|
|
|
## Services
|
|
|
|
###
|
2024-05-15 10:17:27 -06:00
|
|
|
virtualisation.docker.enable = true;
|
2024-07-22 13:30:55 -06:00
|
|
|
services.blueman.enable = true;
|
|
|
|
services.flatpak.enable = true;
|
2024-04-08 12:59:59 -06:00
|
|
|
services.gvfs.enable = true; # thunar mount, trash, etc
|
|
|
|
services.tumbler.enable = true; # thunar thumbnails
|
2023-12-15 15:50:45 -07:00
|
|
|
services.openssh.enable = true;
|
|
|
|
services.dbus.enable = true;
|
2024-03-18 19:45:31 -06:00
|
|
|
services.syncthing.enable = true;
|
2024-07-22 13:30:55 -06:00
|
|
|
services.gnome.gnome-keyring.enable = true;
|
|
|
|
services.usbmuxd.enable = true;
|
2024-05-15 10:17:27 -06:00
|
|
|
services.tailscale = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
2024-04-12 07:08:56 -06:00
|
|
|
# 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"
|
|
|
|
'';
|
2024-05-15 10:17:27 -06:00
|
|
|
# For yubioath desktop
|
|
|
|
services.pcscd.enable = true;
|
2024-01-22 14:25:27 -07:00
|
|
|
# Audio
|
|
|
|
security.rtkit.enable = true;
|
2023-12-15 15:50:45 -07:00
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa.enable = true;
|
|
|
|
pulse.enable = true;
|
2024-01-22 14:25:27 -07:00
|
|
|
wireplumber.enable = true;
|
2023-12-15 15:50:45 -07:00
|
|
|
};
|
2024-01-22 14:25:27 -07:00
|
|
|
sound.enable = false;
|
2024-07-22 13:30:55 -06:00
|
|
|
|
2023-12-15 15:50:45 -07:00
|
|
|
###
|
|
|
|
## Misc
|
|
|
|
###
|
|
|
|
# Necessary for home-manager sway setup
|
|
|
|
security.polkit.enable = true;
|
|
|
|
|
2024-01-27 12:40:09 -07:00
|
|
|
services.greetd = {
|
|
|
|
enable = true;
|
|
|
|
settings = rec {
|
|
|
|
initial_session = {
|
|
|
|
command = "${pkgs.sway}/bin/sway";
|
|
|
|
user = "nate";
|
|
|
|
};
|
|
|
|
default_session = initial_session;
|
|
|
|
};
|
|
|
|
};
|
2024-01-22 14:25:27 -07:00
|
|
|
|
2024-09-02 14:45:05 -06:00
|
|
|
# services.xserver.videoDrivers = [ "amdgpu" ];
|
2024-01-22 14:25:27 -07:00
|
|
|
# Enable HIP
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
|
|
|
|
];
|
2024-07-22 13:30:55 -06:00
|
|
|
hardware.bluetooth.enable = true; # enables support for Bluetooth
|
|
|
|
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
|
2023-12-15 15:50:45 -07:00
|
|
|
hardware.opengl = {
|
2024-01-20 11:52:14 -07:00
|
|
|
# Mesa
|
2024-11-08 08:52:19 -07:00
|
|
|
enable = true;
|
2024-01-20 11:52:14 -07:00
|
|
|
# Vulkan
|
2024-09-02 14:45:05 -06:00
|
|
|
# driSupport = true;
|
2024-01-22 14:25:27 -07:00
|
|
|
# Rocm support and vulkan drivers
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
rocmPackages.clr.icd
|
|
|
|
];
|
2023-12-15 15:50:45 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|