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:
+18
-11
@@ -34,11 +34,13 @@
|
||||
{
|
||||
options.chiasson.desktop = {
|
||||
defaultSession = lib.mkOption {
|
||||
type = lib.types.nullOr (lib.types.enum [
|
||||
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 [
|
||||
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,9 +84,11 @@
|
||||
};
|
||||
|
||||
displayManager.sddm = {
|
||||
wayland.enable = lib.mkEnableOption ''
|
||||
wayland.enable =
|
||||
lib.mkEnableOption ''
|
||||
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
|
||||
'' // {
|
||||
''
|
||||
// {
|
||||
default = true;
|
||||
};
|
||||
|
||||
@@ -159,10 +165,12 @@
|
||||
};
|
||||
|
||||
keyring = {
|
||||
enable = lib.mkEnableOption ''
|
||||
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; };
|
||||
})
|
||||
];
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
spotify.openDiscoveryFirewall = true;
|
||||
pokeclicker.enable = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
@@ -4,18 +4,5 @@
|
||||
{ self, ... }:
|
||||
{
|
||||
imports = [ self.nixosModules.desktopHomeBase ];
|
||||
|
||||
# Host-only HM overrides (tablet apps, toggles off from desktop-home-base, …).
|
||||
chiasson.users.extraModules.olivier = [
|
||||
# {
|
||||
# chiasson.home = {
|
||||
# # editors.kate.enable = true;
|
||||
# };
|
||||
# }
|
||||
# (
|
||||
# { pkgs, ... }:
|
||||
# { home.packages = with pkgs; [ ]; }
|
||||
# )
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
chiasson.users.extraModules.olivier = [
|
||||
{
|
||||
chiasson.home = {
|
||||
browsers = {
|
||||
edge.enable = true;
|
||||
};
|
||||
browsers.edge.enable = true;
|
||||
|
||||
apps = {
|
||||
discord.enable = true;
|
||||
@@ -19,6 +17,5 @@
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
|
||||
chiasson.users.extraModules.olivier = [
|
||||
{
|
||||
chiasson.home = {
|
||||
hardware.uconsoleGamepad.enable = true;
|
||||
};
|
||||
chiasson.home.hardware.uconsoleGamepad.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user