120 lines
3.8 KiB
Nix
120 lines
3.8 KiB
Nix
{ lib, config, pkgs, modulesPath, inputs, ... }:
|
||
|
||
let
|
||
cfg = config.cspark-desktop-niri;
|
||
in
|
||
{
|
||
imports =
|
||
[
|
||
inputs.niri.nixosModules.niri
|
||
];
|
||
|
||
options.cspark-desktop-niri = {
|
||
enable
|
||
= lib.mkEnableOption "Enable Custom Niri Desktop Setup";
|
||
};
|
||
|
||
config = lib.mkIf cfg.enable {
|
||
# Enable the Niri Compositor and add extra system packages.
|
||
programs.niri.enable = true;
|
||
environment.systemPackages = with pkgs; [
|
||
wl-clipboard
|
||
swaylock # Locking
|
||
swayidle # Idle Detection (For locking)
|
||
swaybg # Set background wallpaper
|
||
foot # Terminal Emulator
|
||
fuzzel # Application Launcher - Wayland
|
||
wdisplays # Manage wayland displays
|
||
wlsunset # Day/night gamma adjustment/filter for wayland
|
||
light # GNU/Linux application to control backlights
|
||
mako # Notification Daemon
|
||
wlprop # Clone of X11 xprop for wayland (To get window class names etc)
|
||
wev # Clone of X11 xev for wayland
|
||
|
||
lxqt.pcmanfm-qt # File Manager
|
||
lxqt.lxqt-archiver # Archiver
|
||
qt6Packages.qt6ct # Manage QT6 Themes
|
||
libsForQt5.qt5ct # Manage QT5 Themes
|
||
lxappearance # Manage GTK Themes
|
||
kdePackages.polkit-kde-agent-1 # Polkit Prompt for password prompts etc
|
||
lxqt.lxqt-openssh-askpass # GUI to query passwords on behalf of SSH agents
|
||
];
|
||
# XDG Portal Integration (For file chooser/screensharing etc)
|
||
xdg.portal.enable = true;
|
||
xdg.portal.wlr.enable = true;
|
||
xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gnome xdg-desktop-portal-gtk ];
|
||
# Whether to enable Qt configuration, including theming.
|
||
qt.enable = true;
|
||
# Enable xwayland support
|
||
programs.xwayland.enable = true;
|
||
# Enable polkit
|
||
security.polkit.enable = true;
|
||
# For udiskie
|
||
services.udisks2.enable = true;
|
||
|
||
# Whether to enable GNOME Keyring daemon, a service designed to take care of the user’s security credentials, such as user names and passwords.
|
||
services.gnome.gnome-keyring.enable = true;
|
||
|
||
# GTK themes are not applied in Wayland applications / Window Decorations missing / Cursor looks different
|
||
programs.dconf.enable = true;
|
||
|
||
# Enable CUPS to print documents.
|
||
services.printing.enable = true;
|
||
|
||
# Enable sound with pipewire.
|
||
sound.enable = true;
|
||
hardware.pulseaudio.enable = false;
|
||
security.rtkit.enable = true;
|
||
services.pipewire = {
|
||
enable = true;
|
||
alsa.enable = true;
|
||
alsa.support32Bit = true;
|
||
pulse.enable = true;
|
||
# If you want to use JACK applications, uncomment this
|
||
jack.enable = true;
|
||
|
||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||
# no need to redefine it in your config for now)
|
||
#media-session.enable = true;
|
||
};
|
||
|
||
security.sudo = {
|
||
extraRules = [
|
||
{
|
||
commands = [
|
||
{
|
||
command = "/run/current-system/sw/bin/light";
|
||
options = [ "NOPASSWD" ];
|
||
}
|
||
];
|
||
groups = [ "wheel" ];
|
||
}
|
||
];
|
||
};
|
||
|
||
environment.sessionVariables = {
|
||
TERM = "foot";
|
||
QT_QPA_PLATFORM = "wayland";
|
||
QT_QPA_PLATFORMTHEME = "qt6ct";
|
||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||
SDL_VIDEODRIVER = "wayland";
|
||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||
SSH_ASKPASS = "lxqt-openssh-askpass";
|
||
# Enable native wayland support for chromium and electron based applications
|
||
NIXOS_OZONE_WL = "1";
|
||
};
|
||
environment.variables = {
|
||
TERM = "foot";
|
||
QT_QPA_PLATFORM = "wayland";
|
||
QT_QPA_PLATFORMTHEME = "qt6ct";
|
||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||
SDL_VIDEODRIVER = "wayland";
|
||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||
SSH_ASKPASS = lib.mkForce "lxqt-openssh-askpass";
|
||
# Enable native wayland support for chromium and electron based applications
|
||
NIXOS_OZONE_WL = "1";
|
||
};
|
||
|
||
};
|
||
}
|