1
1
Fork 0

desktops: add main desktop option for use with module conditions

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-24 09:26:54 -05:00
parent 99e0c4ec14
commit 7d2190a8f0
Signed by: myned
GPG key ID: C7224454F7881A34
4 changed files with 27 additions and 12 deletions

View file

@ -3,12 +3,21 @@
lib,
...
}:
with lib; {
config.custom.desktops = mkIf config.custom.full {
#// gnome.enable = true;
#// hyprland.enable = true;
#// kde.enable = true;
niri.enable = true;
#// sway.enable = true;
with lib; let
cfg = config.custom.desktops;
in {
options.custom.desktops = {
enable = mkOption {default = config.custom.minimal;};
desktop = mkOption {default = "niri";};
};
config = mkIf cfg.enable {
custom.desktops = {
gnome.enable = cfg.desktop == "gnome";
hyprland.enable = cfg.desktop == "hyprland";
kde.enable = cfg.desktop == "kde";
niri.enable = cfg.desktop == "niri";
sway.enable = cfg.desktop == "sway";
};
};
}

View file

@ -9,6 +9,7 @@ with lib; let
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
loginctl = "${pkgs.systemd}/bin/loginctl";
niri = "${config.programs.niri.package}/bin/niri";
pgrep = "${pkgs.procps}/bin/pgrep";
pw-cli = "${pkgs.pipewire}/bin/pw-cli";
systemctl = "${pkgs.systemd}/bin/systemctl";
@ -37,7 +38,12 @@ in {
{
timeout = 20 * 60; # Seconds
on-timeout = "${hyprctl} dispatch dpms off";
on-timeout =
if config.custom.desktops.desktop == "hyprland"
then "${hyprctl} dispatch dpms off"
else if config.custom.desktops.desktop == "niri"
then "${niri} msg action power-off-monitors"
else "";
}
{

View file

@ -12,9 +12,9 @@
minimal = true;
profile = "console";
desktops.gnome = {
enable = true;
gdm = false;
desktops = {
desktop = "gnome";
gnome.gdm = false;
};
programs = {

View file

@ -1,7 +1,7 @@
{
custom = {
full = true;
profile = "desktop"; # Inherit desktop
profile = "desktop"; # Inherit desktop profile
};
#!! Rebuild offline - drastically increases initial download and resulting closure size