Unverified Commit e677e705 authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

waybar: include the systemd user unit (#340874)

parents 431a08b8 a03d5e6f
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
{ lib, pkgs, config, ... }:
{
  lib,
  pkgs,
  config,
  ...
}:

let
  cfg = config.programs.waybar;
@@ -11,11 +16,9 @@ in

  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    systemd.user.services.waybar = {
      description = "Waybar as systemd service";
      wantedBy = [ "graphical-session.target" ];
      partOf = [ "graphical-session.target" ];
      script = "${cfg.package}/bin/waybar";
    systemd = {
      packages = [ cfg.package ];
      user.services.waybar.wantedBy = [ "graphical-session.target" ];
    };
  };

+3 −1
Original line number Diff line number Diff line
@@ -179,13 +179,15 @@ stdenv.mkDerivation (finalAttrs: {
      "pulseaudio" = pulseSupport;
      "rfkill" = rfkillSupport;
      "sndio" = sndioSupport;
      "systemd" = false;
      "systemd" = true;
      "tests" = runTests;
      "upower_glib" = upowerSupport;
      "wireplumber" = wireplumberSupport;
    })
    ++ lib.optional experimentalPatches (lib.mesonBool "experimental" true);

  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";

  postPatch = ''
    substituteInPlace include/util/command.hpp \
      --replace-fail /bin/sh ${lib.getExe' bash "sh"}