waybar: include the systemd user unit (#340874)

This commit is contained in:
Masum Reza 2024-09-22 00:29:40 +05:30 committed by GitHub
commit e677e7056c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,9 @@
{ 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" ];
};
};

View File

@ -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"}