From ba0f895f66050651848cefe93c58301535e45cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlys=20Bras=20de=20fer?= Date: Mon, 5 Aug 2024 09:07:41 +0000 Subject: [PATCH] nixos/waybar: use upstream service file --- nixos/modules/programs/wayland/waybar.nix | 8 ++------ pkgs/by-name/wa/waybar/package.nix | 6 +++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nixos/modules/programs/wayland/waybar.nix b/nixos/modules/programs/wayland/waybar.nix index ab811994be073..b1dec0849c486 100644 --- a/nixos/modules/programs/wayland/waybar.nix +++ b/nixos/modules/programs/wayland/waybar.nix @@ -11,12 +11,8 @@ 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 ]; + systemd.user.services.waybar.wantedBy = [ "graphical-session.target" ]; }; meta.maintainers = [ lib.maintainers.FlorianFranzen ]; diff --git a/pkgs/by-name/wa/waybar/package.nix b/pkgs/by-name/wa/waybar/package.nix index c92d04e5a9828..89b3b3c89f24d 100644 --- a/pkgs/by-name/wa/waybar/package.nix +++ b/pkgs/by-name/wa/waybar/package.nix @@ -37,6 +37,7 @@ sndio, spdlog, sway, + systemd, udev, upower, wayland, @@ -120,6 +121,7 @@ stdenv.mkDerivation (finalAttrs: { libsigcxx libxkbcommon spdlog + systemd wayland ] ++ lib.optionals cavaSupport [ @@ -166,13 +168,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"}