commit
ef64efdbac
24 changed files with 80 additions and 52 deletions
|
@ -417,6 +417,7 @@ let
|
||||||
./systemd.nix
|
./systemd.nix
|
||||||
./targets/darwin
|
./targets/darwin
|
||||||
./targets/generic-linux.nix
|
./targets/generic-linux.nix
|
||||||
|
./wayland.nix
|
||||||
./xresources.nix
|
./xresources.nix
|
||||||
./xsession.nix
|
./xsession.nix
|
||||||
./misc/nix.nix
|
./misc/nix.nix
|
||||||
|
|
|
@ -199,7 +199,8 @@ in {
|
||||||
|
|
||||||
systemd.target = mkOption {
|
systemd.target = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = "graphical-session.target";
|
default = config.wayland.systemd.target;
|
||||||
|
defaultText = literalExpression "config.wayland.systemd.target";
|
||||||
example = "sway-session.target";
|
example = "sway-session.target";
|
||||||
description = ''
|
description = ''
|
||||||
The systemd target that will automatically start the Waybar service.
|
The systemd target that will automatically start the Waybar service.
|
||||||
|
@ -309,8 +310,9 @@ in {
|
||||||
Description =
|
Description =
|
||||||
"Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
"Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
||||||
Documentation = "https://github.com/Alexays/Waybar/wiki";
|
Documentation = "https://github.com/Alexays/Waybar/wiki";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ cfg.systemd.target ];
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ cfg.systemd.target ];
|
||||||
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
X-Restart-Triggers = optional (settings != [ ])
|
X-Restart-Triggers = optional (settings != [ ])
|
||||||
"${config.xdg.configFile."waybar/config".source}"
|
"${config.xdg.configFile."waybar/config".source}"
|
||||||
++ optional (cfg.style != null)
|
++ optional (cfg.style != null)
|
||||||
|
|
|
@ -57,8 +57,8 @@ in {
|
||||||
services.avizo = {
|
services.avizo = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Volume/backlight OSD indicator";
|
Description = "Volume/backlight OSD indicator";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = [ "graphical-session.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
Documentation = "man:avizo(1)";
|
Documentation = "man:avizo(1)";
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,7 @@ in {
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ config.wayland.systemd.target ]; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,8 @@ in {
|
||||||
|
|
||||||
systemdTarget = mkOption {
|
systemdTarget = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "graphical-session.target";
|
default = config.wayland.systemd.target;
|
||||||
|
defaultText = literalExpression "config.wayland.systemd.target";
|
||||||
example = "sway-session.target";
|
example = "sway-session.target";
|
||||||
description = ''
|
description = ''
|
||||||
The systemd target that will automatically start the clipman service.
|
The systemd target that will automatically start the clipman service.
|
||||||
|
@ -34,8 +35,9 @@ in {
|
||||||
systemd.user.services.clipman = {
|
systemd.user.services.clipman = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Clipboard management daemon";
|
Description = "Clipboard management daemon";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ cfg.systemdTarget ];
|
||||||
After = [ "graphical-session.target" ];
|
After = [ cfg.systemdTarget ];
|
||||||
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|
|
@ -180,8 +180,8 @@ in {
|
||||||
systemd.user.services.dunst = {
|
systemd.user.services.dunst = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Dunst notification daemon";
|
Description = "Dunst notification daemon";
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|
|
@ -88,8 +88,9 @@ in {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Fnott notification daemon";
|
Description = "Fnott notification daemon";
|
||||||
Documentation = "man:fnott(1)";
|
Documentation = "man:fnott(1)";
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|
|
@ -74,13 +74,13 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.hypridle = {
|
systemd.user.services.hypridle = {
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ config.wayland.systemd.target ]; };
|
||||||
|
|
||||||
Unit = {
|
Unit = {
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
Description = "hypridle";
|
Description = "hypridle";
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
X-Restart-Triggers = mkIf (cfg.settings != { })
|
X-Restart-Triggers = mkIf (cfg.settings != { })
|
||||||
[ "${config.xdg.configFile."hypr/hypridle.conf".source}" ];
|
[ "${config.xdg.configFile."hypr/hypridle.conf".source}" ];
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,13 +68,13 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.hyprpaper = {
|
systemd.user.services.hyprpaper = {
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ config.wayland.systemd.target ]; };
|
||||||
|
|
||||||
Unit = {
|
Unit = {
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
Description = "hyprpaper";
|
Description = "hyprpaper";
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
X-Restart-Triggers = mkIf (cfg.settings != { })
|
X-Restart-Triggers = mkIf (cfg.settings != { })
|
||||||
[ "${config.xdg.configFile."hypr/hyprpaper.conf".source}" ];
|
[ "${config.xdg.configFile."hypr/hyprpaper.conf".source}" ];
|
||||||
};
|
};
|
||||||
|
|
|
@ -286,7 +286,8 @@ in {
|
||||||
|
|
||||||
systemdTarget = mkOption {
|
systemdTarget = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "sway-session.target";
|
default = config.wayland.systemd.target;
|
||||||
|
defaultText = literalExpression "config.wayland.systemd.target";
|
||||||
description = ''
|
description = ''
|
||||||
Systemd target to bind to.
|
Systemd target to bind to.
|
||||||
'';
|
'';
|
||||||
|
@ -342,6 +343,7 @@ in {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Dynamic output configuration";
|
Description = "Dynamic output configuration";
|
||||||
Documentation = "man:kanshi(1)";
|
Documentation = "man:kanshi(1)";
|
||||||
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
PartOf = cfg.systemdTarget;
|
PartOf = cfg.systemdTarget;
|
||||||
Requires = cfg.systemdTarget;
|
Requires = cfg.systemdTarget;
|
||||||
After = cfg.systemdTarget;
|
After = cfg.systemdTarget;
|
||||||
|
|
|
@ -88,7 +88,8 @@ in {
|
||||||
|
|
||||||
systemdTarget = mkOption {
|
systemdTarget = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "graphical-session.target";
|
default = config.wayland.systemd.target;
|
||||||
|
defaultText = literalExpression "config.wayland.systemd.target";
|
||||||
example = "sway-session.target";
|
example = "sway-session.target";
|
||||||
description = ''
|
description = ''
|
||||||
Systemd target to bind to.
|
Systemd target to bind to.
|
||||||
|
@ -107,7 +108,8 @@ in {
|
||||||
Description = "Idle manager for Wayland";
|
Description = "Idle manager for Wayland";
|
||||||
Documentation = "man:swayidle(1)";
|
Documentation = "man:swayidle(1)";
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ cfg.systemdTarget ];
|
||||||
|
After = [ cfg.systemdTarget ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|
|
@ -95,8 +95,8 @@ in {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Swaync notification daemon";
|
Description = "Swaync notification daemon";
|
||||||
Documentation = "https://github.com/ErikReider/SwayNotificationCenter";
|
Documentation = "https://github.com/ErikReider/SwayNotificationCenter";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ in {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = [ config.wayland.systemd.target ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ in {
|
||||||
services.swayosd = {
|
services.swayosd = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Volume/backlight OSD indicator";
|
Description = "Volume/backlight OSD indicator";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = [ "graphical-session.target" ];
|
After = [ config.wayland.systemd.target ];
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
Documentation = "man:swayosd(1)";
|
Documentation = "man:swayosd(1)";
|
||||||
StartLimitBurst = 5;
|
StartLimitBurst = 5;
|
||||||
|
@ -76,7 +76,7 @@ in {
|
||||||
RestartSec = "2s";
|
RestartSec = "2s";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ config.wayland.systemd.target ]; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,8 +50,8 @@ in {
|
||||||
Description =
|
Description =
|
||||||
"A lightweight overlay volume/backlight/progress/anything bar for Wayland";
|
"A lightweight overlay volume/backlight/progress/anything bar for Wayland";
|
||||||
Documentation = "man:wob(1)";
|
Documentation = "man:wob(1)";
|
||||||
PartOf = "graphical-session.target";
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = "graphical-session.target";
|
After = [ config.wayland.systemd.target ];
|
||||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
|
@ -59,7 +59,7 @@ in {
|
||||||
ExecStart = builtins.concatStringsSep " " ([ (getExe cfg.package) ]
|
ExecStart = builtins.concatStringsSep " " ([ (getExe cfg.package) ]
|
||||||
++ optional (cfg.settings != { }) "--config ${configFile}");
|
++ optional (cfg.settings != { }) "--config ${configFile}");
|
||||||
};
|
};
|
||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = [ config.wayland.systemd.target ];
|
||||||
};
|
};
|
||||||
|
|
||||||
sockets.wob = {
|
sockets.wob = {
|
||||||
|
|
24
modules/wayland.nix
Normal file
24
modules/wayland.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
meta.maintainers = [ lib.maintainers.thiagokokada ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
wayland = {
|
||||||
|
systemd.target = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "graphical-session.target";
|
||||||
|
example = "sway-session.target";
|
||||||
|
description = ''
|
||||||
|
The systemd target that will automatically start the graphical Wayland services.
|
||||||
|
This option is a generalization of individual `systemd.target` or `systemdTarget`,
|
||||||
|
and affect all Wayland services by default.
|
||||||
|
|
||||||
|
When setting this value to `"sway-session.target"`,
|
||||||
|
make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`,
|
||||||
|
otherwise the service may never be started.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
home.stateVersion = "21.11";
|
home.stateVersion = "21.11";
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -8,7 +8,8 @@ KillMode=mixed
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
After=graphical-session-pre.target
|
After=sway-session.target
|
||||||
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
|
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
|
||||||
Documentation=https://github.com/Alexays/Waybar/wiki
|
Documentation=https://github.com/Alexays/Waybar/wiki
|
||||||
PartOf=graphical-session.target
|
PartOf=sway-session.target
|
||||||
|
|
|
@ -8,6 +8,7 @@ KillMode=mixed
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
After=graphical-session.target
|
After=sway-session.target
|
||||||
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
Description=Clipboard management daemon
|
Description=Clipboard management daemon
|
||||||
PartOf=graphical-session.target
|
PartOf=sway-session.target
|
||||||
|
|
|
@ -4,7 +4,8 @@ ExecStart=@fnott@/bin/fnott -c /home/hm-user/.config/fnott/fnott.ini
|
||||||
Type=dbus
|
Type=dbus
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
After=graphical-session-pre.target
|
After=graphical-session.target
|
||||||
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
Description=Fnott notification daemon
|
Description=Fnott notification daemon
|
||||||
Documentation=man:fnott(1)
|
Documentation=man:fnott(1)
|
||||||
PartOf=graphical-session.target
|
PartOf=graphical-session.target
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.swayidle = {
|
services.swayidle = {
|
||||||
|
@ -50,6 +50,7 @@
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
|
After=graphical-session.target
|
||||||
ConditionEnvironment=WAYLAND_DISPLAY
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
Description=Idle manager for Wayland
|
Description=Idle manager for Wayland
|
||||||
Documentation=man:swayidle(1)
|
Documentation=man:swayidle(1)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
Type=dbus
|
Type=dbus
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
After=graphical-session-pre.target
|
After=graphical-session.target
|
||||||
ConditionEnvironment=WAYLAND_DISPLAY
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
Description=Swaync notification daemon
|
Description=Swaync notification daemon
|
||||||
Documentation=https://github.com/ErikReider/SwayNotificationCenter
|
Documentation=https://github.com/ErikReider/SwayNotificationCenter
|
||||||
|
|
Loading…
Reference in a new issue