style(desktop): reformat nix code and simplify module logic

Refactor `modules/desktop/options.nix` to improve code readability through
consistent indentation and whitespace management. Simplified the
conditional logic for `home-manager.extraSpecialArgs` to remove
unnecessary complexity.

Clean up host configurations by removing commented-out code, removing
unnecessary whitespace, and flattening nested attribute sets into
single-line declarations where appropriate.
This commit is contained in:
2026-07-15 22:20:07 -03:00
parent e2fd47aa58
commit a787840ce2
5 changed files with 32 additions and 44 deletions
+30 -23
View File
@@ -34,11 +34,13 @@
{
options.chiasson.desktop = {
defaultSession = lib.mkOption {
type = lib.types.nullOr (lib.types.enum [
"hyprland"
"niri"
"plasma"
]);
type = lib.types.nullOr (
lib.types.enum [
"hyprland"
"niri"
"plasma"
]
);
default = null;
example = "niri";
description = ''
@@ -56,10 +58,12 @@
displayManager = {
variant = lib.mkOption {
type = lib.types.nullOr (lib.types.enum [
"sddm"
"dankgreeter"
]);
type = lib.types.nullOr (
lib.types.enum [
"sddm"
"dankgreeter"
]
);
default = null;
description = ''
SDDM vs DankGreeter (greetd + DMS [docs](https://danklinux.com/docs/dankgreeter/nixos-flake)).
@@ -80,11 +84,13 @@
};
displayManager.sddm = {
wayland.enable = lib.mkEnableOption ''
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
'' // {
default = true;
};
wayland.enable =
lib.mkEnableOption ''
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
''
// {
default = true;
};
enableHidpi = lib.mkOption {
type = lib.types.bool;
@@ -159,12 +165,14 @@
};
keyring = {
enable = lib.mkEnableOption ''
gnome-keyring + pam (login + sddm or greetd) + HM user service + `gcr` + `services.xserver.updateDbusEnvironment`.
niri/hyprland: `dbus-update-activation-environment` at compositor start so libsecret/Electron see `WAYLAND_DISPLAY`.
'' // {
default = true;
};
enable =
lib.mkEnableOption ''
gnome-keyring + pam (login + sddm or greetd) + HM user service + `gcr` + `services.xserver.updateDbusEnvironment`.
niri/hyprland: `dbus-update-activation-environment` at compositor start so libsecret/Electron see `WAYLAND_DISPLAY`.
''
// {
default = true;
};
};
};
@@ -184,8 +192,7 @@
message = "chiasson.desktop.defaultSession = \"plasma\" requires chiasson.desktop.plasma.enable = true.";
}
{
assertion =
cfg.displayManager.variant != "dankgreeter" || cfg.hyprland.enable || cfg.niri.enable;
assertion = cfg.displayManager.variant != "dankgreeter" || cfg.hyprland.enable || cfg.niri.enable;
message = "chiasson.desktop.displayManager.variant = \"dankgreeter\" requires chiasson.desktop.hyprland or chiasson.desktop.niri.";
}
{
@@ -210,7 +217,7 @@
(lib.mkIf (dmsEnabled && hmAvailable) {
"home-manager".sharedModules = [ self.homeManagerModules.desktopShellDms ];
})
(lib.mkIf (hmAvailable && (dmsEnabled || cfg.niri.enable)) {
(lib.mkIf hmAvailable {
"home-manager".extraSpecialArgs = { inherit inputs; };
})
];