nixpkgs-suyu/nixos/modules/programs/waybar.nix
rewine ffcf148a8d
nixos/waybar: allow change waybar package to use
also add waybar package to environment.systemPackages
2023-03-08 17:16:37 +08:00

25 lines
591 B
Nix

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.programs.waybar;
in
{
options.programs.waybar = {
enable = mkEnableOption (lib.mdDoc "waybar");
package = mkPackageOptionMD pkgs "waybar" { };
};
config = 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";
};
};
meta.maintainers = [ maintainers.FlorianFranzen ];
}