1
1
Fork 0

Compare commits

..

No commits in common. "7d2190a8f0e28e5e9f7992131029947fbd7ef471" and "d20ba24b96cc97bcc80a3156133a96f7f6ddc635" have entirely different histories.

4 changed files with 12 additions and 35 deletions

View file

@ -3,21 +3,12 @@
lib, lib,
... ...
}: }:
with lib; let with lib; {
cfg = config.custom.desktops; config.custom.desktops = mkIf config.custom.full {
in { #// gnome.enable = true;
options.custom.desktops = { #// hyprland.enable = true;
enable = mkOption {default = config.custom.minimal;}; #// kde.enable = true;
desktop = mkOption {default = "niri";}; niri.enable = true;
}; #// sway.enable = true;
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,7 +9,6 @@ with lib; let
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl"; hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock"; hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
loginctl = "${pkgs.systemd}/bin/loginctl"; loginctl = "${pkgs.systemd}/bin/loginctl";
niri = "${config.programs.niri.package}/bin/niri";
pgrep = "${pkgs.procps}/bin/pgrep"; pgrep = "${pkgs.procps}/bin/pgrep";
pw-cli = "${pkgs.pipewire}/bin/pw-cli"; pw-cli = "${pkgs.pipewire}/bin/pw-cli";
systemctl = "${pkgs.systemd}/bin/systemctl"; systemctl = "${pkgs.systemd}/bin/systemctl";
@ -38,12 +37,7 @@ in {
{ {
timeout = 20 * 60; # Seconds timeout = 20 * 60; # Seconds
on-timeout = on-timeout = "${hyprctl} dispatch dpms off";
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 "";
} }
{ {
@ -53,13 +47,5 @@ in {
]; ];
}; };
}; };
# BUG: graphical-session-pre.target may not have WAYLAND_DISPLAY set, so service is skipped
# https://github.com/nix-community/home-manager/issues/5899
systemd.user.services.hypridle = {
Unit = {
After = mkForce ["graphical-session.target"]; # graphical-session-pre.target
};
};
}; };
} }

View file

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

View file

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