feat: Enable sway at the NixOS level
This commit is contained in:
parent
92133a3138
commit
751b122587
3 changed files with 12 additions and 4 deletions
|
@ -2,8 +2,9 @@
|
||||||
let
|
let
|
||||||
inherit (config) jhome;
|
inherit (config) jhome;
|
||||||
flatpakEnabled = if osConfig != null then osConfig.services.flatpak.enable else false;
|
flatpakEnabled = if osConfig != null then osConfig.services.flatpak.enable else false;
|
||||||
|
osSway = osConfig == null && !osConfig.programs.sway.enable;
|
||||||
|
swayPkg = if osSway then pkgs.sway else null;
|
||||||
cfg = jhome.gui;
|
cfg = jhome.gui;
|
||||||
swaycfg = config.wayland.windowManager.sway.config;
|
|
||||||
cursor.package = pkgs.nordzy-cursor-theme;
|
cursor.package = pkgs.nordzy-cursor-theme;
|
||||||
cursor.name = "Nordzy-cursors";
|
cursor.name = "Nordzy-cursors";
|
||||||
iconTheme.name = "Papirus-Dark";
|
iconTheme.name = "Papirus-Dark";
|
||||||
|
@ -27,7 +28,7 @@ in
|
||||||
# Dynamic Menu
|
# Dynamic Menu
|
||||||
programs.fuzzel.enable = true;
|
programs.fuzzel.enable = true;
|
||||||
programs.fuzzel.settings.main.icon-theme = "Papirus-Dark";
|
programs.fuzzel.settings.main.icon-theme = "Papirus-Dark";
|
||||||
programs.fuzzel.settings.main.terminal = swaycfg.terminal;
|
programs.fuzzel.settings.main.terminal = cfg.terminal;
|
||||||
programs.fuzzel.settings.main.layer = "overlay";
|
programs.fuzzel.settings.main.layer = "overlay";
|
||||||
# Video player
|
# Video player
|
||||||
programs.mpv.enable = true;
|
programs.mpv.enable = true;
|
||||||
|
@ -66,6 +67,7 @@ in
|
||||||
|
|
||||||
# Window Manager
|
# Window Manager
|
||||||
wayland.windowManager.sway.enable = true;
|
wayland.windowManager.sway.enable = true;
|
||||||
|
wayland.windowManager.sway.package = swayPkg; # no sway package if it comes from the OS
|
||||||
wayland.windowManager.sway.config = import ./sway-config.nix { inherit config pkgs; };
|
wayland.windowManager.sway.config = import ./sway-config.nix { inherit config pkgs; };
|
||||||
|
|
||||||
# Set cursor style
|
# Set cursor style
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.jconfig.gui;
|
cfg = config.jconfig.gui;
|
||||||
|
enable = config.jconfig.enable && cfg.enable;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
(lib.mkIf (config.jconfig.enable && cfg.enable) {
|
(lib.mkIf enable {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.gnome.adwaita-icon-theme
|
pkgs.gnome.adwaita-icon-theme
|
||||||
pkgs.adwaita-qt
|
pkgs.adwaita-qt
|
||||||
|
@ -33,6 +34,10 @@ in
|
||||||
programs.light.enable = true;
|
programs.light.enable = true;
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
|
programs.sway.enable = cfg.sway;
|
||||||
|
programs.sway.wrapperFeatures.base = true;
|
||||||
|
programs.sway.wrapperFeatures.gtk = true;
|
||||||
|
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
security.rtkit.enable = true; # Recommended for pipewire
|
security.rtkit.enable = true; # Recommended for pipewire
|
||||||
|
|
||||||
|
@ -57,7 +62,7 @@ in
|
||||||
hardware.uinput.enable = true;
|
hardware.uinput.enable = true;
|
||||||
hardware.steam-hardware.enable = cfg.steamHardwareSupport;
|
hardware.steam-hardware.enable = cfg.steamHardwareSupport;
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg."8bitdoFix" {
|
(lib.mkIf (enable && cfg."8bitdoFix") {
|
||||||
# Udev rules to start or stop systemd service when controller is connected or disconnected
|
# Udev rules to start or stop systemd service when controller is connected or disconnected
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
# May vary depending on your controller model, find product id using 'lsusb'
|
# May vary depending on your controller model, find product id using 'lsusb'
|
||||||
|
|
|
@ -24,6 +24,7 @@ let
|
||||||
options.autoStart = mkDisableOption "autostarting ydotool at login";
|
options.autoStart = mkDisableOption "autostarting ydotool at login";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
sway = mkDisableOption "sway";
|
||||||
};
|
};
|
||||||
|
|
||||||
styling.options = {
|
styling.options = {
|
||||||
|
|
Loading…
Reference in a new issue