Option: added active desktop option which allows kde to be primary desktop environment.
This commit is contained in:
parent
d233e18593
commit
f622009e87
17 changed files with 82 additions and 60 deletions
|
|
@ -21,8 +21,20 @@ in {
|
|||
enable = mkEO "enable desktop related programs (+home manager).";
|
||||
apps = mkEO "extra bloat.";
|
||||
games = mkEO "gaming related programs";
|
||||
|
||||
hyprland = mkEO "enable hyprland related programs.";
|
||||
kde = mkEO "enable kde specialisation.";
|
||||
activeDesktop = lib.mkOption {
|
||||
type = lib.types.enum ["hyprland" "kde"];
|
||||
description = "What desktop should be the default, other enabled desktops will be specialized.";
|
||||
default =
|
||||
if cfg.hyprland
|
||||
then "hyprland"
|
||||
else if cfg.kde
|
||||
then "kde"
|
||||
else "hyprland";
|
||||
example = "hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
config.assertions = mkIf (cfg.hyprland
|
||||
|
|
|
|||
|
|
@ -5,21 +5,9 @@
|
|||
}: {
|
||||
config = lib.mkIf config.niksos.desktop.enable {
|
||||
# greetd display manager
|
||||
services.greetd = let
|
||||
session = {
|
||||
command = lib.mkDefault "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
|
||||
user = "jsw";
|
||||
};
|
||||
in {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
terminal.vt = 1;
|
||||
default_session = session;
|
||||
initial_session = session;
|
||||
};
|
||||
settings.terminal.vt = 1;
|
||||
};
|
||||
|
||||
programs.uwsm.enable = config.niksos.desktop.hyprland;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,37 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
inherit (config.niksos) desktop;
|
||||
cfg = desktop.enable && desktop.hyprland;
|
||||
active = cfg && desktop.activeDesktop == "hyprland";
|
||||
ifActive = x: lib.mkIf active x;
|
||||
in {
|
||||
config = lib.mkIf cfg {
|
||||
programs.hyprland = {
|
||||
specialisation.hyprland.configuration =
|
||||
lib.mkIf cfg
|
||||
&& !active {
|
||||
niksos.desktop.activeDesktop = lib.mkForce "hyprland";
|
||||
};
|
||||
|
||||
programs = ifActive {
|
||||
hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland.
|
||||
uwsm.enable = true;
|
||||
};
|
||||
|
||||
services.greetd.settings = let
|
||||
session = {
|
||||
command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
|
||||
user = "jsw";
|
||||
};
|
||||
in
|
||||
ifActive {
|
||||
default_session = session;
|
||||
initial_session = session;
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = ifActive "1"; # Makes electron apps use wayland.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,25 +4,28 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.kde;
|
||||
inherit (config.niksos) desktop;
|
||||
cfg = desktop.enable && desktop.kde;
|
||||
active = cfg && desktop.activeDesktop == "kde";
|
||||
ifActive = x: lib.mkIf active x;
|
||||
in {
|
||||
specialisation.de.configuration = lib.mkIf cfg {
|
||||
niksos.desktop.hyprland = lib.mkForce false;
|
||||
services = {
|
||||
greetd = let
|
||||
session.command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
terminal.vt = 1;
|
||||
default_session = session;
|
||||
initial_session = session;
|
||||
};
|
||||
};
|
||||
|
||||
desktopManager.plasma6.enable = true;
|
||||
specialisation.kde.configuration =
|
||||
lib.mkIf cfg
|
||||
&& !active {
|
||||
niksos.desktop.activeDesktop = lib.mkForce "kde";
|
||||
};
|
||||
|
||||
home-manager.users.jsw.stylix.autoEnable = false;
|
||||
services = ifActive {
|
||||
greetd.settings = let
|
||||
session.command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
|
||||
in {
|
||||
default_session = session;
|
||||
initial_session = session;
|
||||
};
|
||||
|
||||
desktopManager.plasma6.enable = true;
|
||||
};
|
||||
home-manager.users = ifActive {
|
||||
jsw.stylix.autoEnable = false;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
in {
|
||||
systemd.user.services.polkit-gnome-authentication-agent-1 = lib.mkIf cfg {
|
||||
}: {
|
||||
systemd.user.services.polkit-gnome-authentication-agent-1 = lib.mkIf config.programs.hyprland.enable {
|
||||
description = "polkit-gnome-authentication-agent-1";
|
||||
wantedBy = ["graphical-session.target"];
|
||||
wants = ["graphical-session.target"];
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
in {
|
||||
xdg.portal = lib.mkIf cfg {
|
||||
}: {
|
||||
xdg.portal = lib.mkIf config.programs.hyprland.enable {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -5,20 +5,21 @@
|
|||
...
|
||||
}: let
|
||||
inherit (config.niksos) hardware desktop;
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib) mkIf;
|
||||
uwsm = lib.getExe pkgs.uwsm;
|
||||
foot = lib.getExe pkgs.foot;
|
||||
hypr = config.programs.hyprland.enable;
|
||||
in {
|
||||
config = mkIf hardware.fingerprint {
|
||||
services = {
|
||||
fprintd.enable = true;
|
||||
logind.extraConfig = mkIf desktop.hyprland ''
|
||||
logind.extraConfig = mkIf hypr ''
|
||||
# don’t shutdown when power button is short-pressed
|
||||
HandlePowerKey=ignore
|
||||
'';
|
||||
};
|
||||
|
||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf desktop.hyprland {
|
||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf hypr {
|
||||
bind = [
|
||||
", XF86PowerOff, exec, ${uwsm} app -- pgrep fprintd-verify && exit 0 || ${foot} -a 'foot-fprintd' sh -c 'fprintd-verify && systemctl sleep'"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) optionals mkEnableOption mkDefault;
|
||||
inherit (lib) optionals mkDefault;
|
||||
inherit (config.niksos.hardware) graphics;
|
||||
inherit (graphics) enable nvidia intel;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: {
|
||||
config.services = lib.mkIf config.niksos.hardware.joycond {
|
||||
services = lib.mkIf config.niksos.hardware.joycond {
|
||||
usbmuxd.enable = true;
|
||||
joycond.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ in {
|
|||
power-profiles-daemon.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = lib.mkIf niksos.desktop.hyprland [
|
||||
environment.systemPackages = lib.mkIf config.programs.hyprland.enable [
|
||||
(pkgs.writeScriptBin "powermode" ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue