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:
+30
-23
@@ -34,11 +34,13 @@
|
|||||||
{
|
{
|
||||||
options.chiasson.desktop = {
|
options.chiasson.desktop = {
|
||||||
defaultSession = lib.mkOption {
|
defaultSession = lib.mkOption {
|
||||||
type = lib.types.nullOr (lib.types.enum [
|
type = lib.types.nullOr (
|
||||||
"hyprland"
|
lib.types.enum [
|
||||||
"niri"
|
"hyprland"
|
||||||
"plasma"
|
"niri"
|
||||||
]);
|
"plasma"
|
||||||
|
]
|
||||||
|
);
|
||||||
default = null;
|
default = null;
|
||||||
example = "niri";
|
example = "niri";
|
||||||
description = ''
|
description = ''
|
||||||
@@ -56,10 +58,12 @@
|
|||||||
|
|
||||||
displayManager = {
|
displayManager = {
|
||||||
variant = lib.mkOption {
|
variant = lib.mkOption {
|
||||||
type = lib.types.nullOr (lib.types.enum [
|
type = lib.types.nullOr (
|
||||||
"sddm"
|
lib.types.enum [
|
||||||
"dankgreeter"
|
"sddm"
|
||||||
]);
|
"dankgreeter"
|
||||||
|
]
|
||||||
|
);
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
SDDM vs DankGreeter (greetd + DMS — [docs](https://danklinux.com/docs/dankgreeter/nixos-flake)).
|
SDDM vs DankGreeter (greetd + DMS — [docs](https://danklinux.com/docs/dankgreeter/nixos-flake)).
|
||||||
@@ -80,11 +84,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
displayManager.sddm = {
|
displayManager.sddm = {
|
||||||
wayland.enable = lib.mkEnableOption ''
|
wayland.enable =
|
||||||
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
|
lib.mkEnableOption ''
|
||||||
'' // {
|
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
|
||||||
default = true;
|
''
|
||||||
};
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
enableHidpi = lib.mkOption {
|
enableHidpi = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
@@ -159,12 +165,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
keyring = {
|
keyring = {
|
||||||
enable = lib.mkEnableOption ''
|
enable =
|
||||||
gnome-keyring + pam (login + sddm or greetd) + HM user service + `gcr` + `services.xserver.updateDbusEnvironment`.
|
lib.mkEnableOption ''
|
||||||
niri/hyprland: `dbus-update-activation-environment` at compositor start so libsecret/Electron see `WAYLAND_DISPLAY`.
|
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;
|
''
|
||||||
};
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,8 +192,7 @@
|
|||||||
message = "chiasson.desktop.defaultSession = \"plasma\" requires chiasson.desktop.plasma.enable = true.";
|
message = "chiasson.desktop.defaultSession = \"plasma\" requires chiasson.desktop.plasma.enable = true.";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion =
|
assertion = cfg.displayManager.variant != "dankgreeter" || cfg.hyprland.enable || cfg.niri.enable;
|
||||||
cfg.displayManager.variant != "dankgreeter" || cfg.hyprland.enable || cfg.niri.enable;
|
|
||||||
message = "chiasson.desktop.displayManager.variant = \"dankgreeter\" requires chiasson.desktop.hyprland or chiasson.desktop.niri.";
|
message = "chiasson.desktop.displayManager.variant = \"dankgreeter\" requires chiasson.desktop.hyprland or chiasson.desktop.niri.";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -210,7 +217,7 @@
|
|||||||
(lib.mkIf (dmsEnabled && hmAvailable) {
|
(lib.mkIf (dmsEnabled && hmAvailable) {
|
||||||
"home-manager".sharedModules = [ self.homeManagerModules.desktopShellDms ];
|
"home-manager".sharedModules = [ self.homeManagerModules.desktopShellDms ];
|
||||||
})
|
})
|
||||||
(lib.mkIf (hmAvailable && (dmsEnabled || cfg.niri.enable)) {
|
(lib.mkIf hmAvailable {
|
||||||
"home-manager".extraSpecialArgs = { inherit inputs; };
|
"home-manager".extraSpecialArgs = { inherit inputs; };
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
spotify.openDiscoveryFirewall = true;
|
spotify.openDiscoveryFirewall = true;
|
||||||
pokeclicker.enable = true;
|
pokeclicker.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,18 +4,5 @@
|
|||||||
{ self, ... }:
|
{ self, ... }:
|
||||||
{
|
{
|
||||||
imports = [ self.nixosModules.desktopHomeBase ];
|
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.users.extraModules.olivier = [
|
||||||
{
|
{
|
||||||
chiasson.home = {
|
chiasson.home = {
|
||||||
browsers = {
|
browsers.edge.enable = true;
|
||||||
edge.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
apps = {
|
apps = {
|
||||||
discord.enable = true;
|
discord.enable = true;
|
||||||
@@ -19,6 +17,5 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,7 @@
|
|||||||
|
|
||||||
chiasson.users.extraModules.olivier = [
|
chiasson.users.extraModules.olivier = [
|
||||||
{
|
{
|
||||||
chiasson.home = {
|
chiasson.home.hardware.uconsoleGamepad.enable = true;
|
||||||
hardware.uconsoleGamepad.enable = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user