mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
waybar: use config.wayland.systemd.target
Also add `ConditionEnvironment`.
This commit is contained in:
committed by
Austin Horstman
parent
b4de3da366
commit
bf60c0be78
@@ -2,7 +2,8 @@
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
all filterAttrs hasAttr isStorePath literalExpression optionalAttrs types;
|
||||
all filterAttrs hasAttr isStorePath literalExpression optionalAttrs optional
|
||||
types;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
||||
@@ -198,7 +199,8 @@ in {
|
||||
|
||||
systemd.target = mkOption {
|
||||
type = str;
|
||||
default = "graphical-session.target";
|
||||
default = config.wayland.systemd.target;
|
||||
defaultText = literalExpression "config.wayland.systemd.target";
|
||||
example = "sway-session.target";
|
||||
description = ''
|
||||
The systemd target that will automatically start the Waybar service.
|
||||
@@ -308,8 +310,13 @@ in {
|
||||
Description =
|
||||
"Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
||||
Documentation = "https://github.com/Alexays/Waybar/wiki";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ cfg.systemd.target ];
|
||||
After = [ cfg.systemd.target ];
|
||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||
X-Restart-Triggers = optional (settings != [ ])
|
||||
"${config.xdg.configFile."waybar/config".source}"
|
||||
++ optional (cfg.style != null)
|
||||
"${config.xdg.configFile."waybar/style.css".source}";
|
||||
};
|
||||
|
||||
Service = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
home.stateVersion = "21.11";
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
|
||||
@@ -8,7 +8,8 @@ KillMode=mixed
|
||||
Restart=on-failure
|
||||
|
||||
[Unit]
|
||||
After=graphical-session-pre.target
|
||||
After=sway-session.target
|
||||
ConditionEnvironment=WAYLAND_DISPLAY
|
||||
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
|
||||
Documentation=https://github.com/Alexays/Waybar/wiki
|
||||
PartOf=graphical-session.target
|
||||
PartOf=sway-session.target
|
||||
|
||||
Reference in New Issue
Block a user