2022-12-06 17:44:26 +00:00
|
|
|
{
|
|
|
|
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
devshell.url = "github:numtide/devshell";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2023-02-16 13:31:02 +00:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-12-06 17:44:26 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 13:31:02 +00:00
|
|
|
outputs = { self, flake-utils, devshell, nixpkgs, flake-compat }:
|
2022-12-06 17:44:26 +00:00
|
|
|
let
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
genSystems = lib.genAttrs [
|
|
|
|
"x86_64-linux"
|
2023-09-19 13:50:39 +00:00
|
|
|
"aarch64-linux"
|
2022-12-06 17:44:26 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pkgsFor = genSystems (system:
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
});
|
|
|
|
|
|
|
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
|
|
|
(builtins.substring 0 4 longDate)
|
|
|
|
(builtins.substring 4 2 longDate)
|
|
|
|
(builtins.substring 6 2 longDate)
|
|
|
|
]);
|
|
|
|
in
|
|
|
|
{
|
2023-07-31 16:37:33 +00:00
|
|
|
overlays.default = final: prev: {
|
|
|
|
waybar = final.callPackage ./nix/default.nix {
|
2023-02-16 11:36:28 +00:00
|
|
|
version = prev.waybar.version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
2022-12-06 17:44:26 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
packages = genSystems
|
|
|
|
(system:
|
2023-07-31 16:37:33 +00:00
|
|
|
(self.overlays.default pkgsFor.${system} pkgsFor.${system})
|
2022-12-06 17:44:26 +00:00
|
|
|
// {
|
|
|
|
default = self.packages.${system}.waybar;
|
|
|
|
});
|
|
|
|
} //
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: {
|
|
|
|
devShell =
|
|
|
|
let pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
|
2023-08-23 17:14:35 +00:00
|
|
|
overlays = [ devshell.overlays.default ];
|
2022-12-06 17:44:26 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.devshell.mkShell {
|
|
|
|
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ];
|
2023-08-23 17:14:35 +00:00
|
|
|
|
2022-12-06 17:44:26 +00:00
|
|
|
devshell.packages = with pkgs; [
|
|
|
|
clang-tools
|
|
|
|
gdb
|
2023-02-16 13:25:07 +00:00
|
|
|
# from nativeBuildInputs
|
|
|
|
gnumake
|
2023-02-16 11:36:28 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
scdoc
|
|
|
|
] ++ (map lib.getDev [
|
|
|
|
# from buildInputs
|
|
|
|
wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon
|
2023-02-16 13:26:57 +00:00
|
|
|
# optional dependencies
|
2023-02-16 11:36:28 +00:00
|
|
|
gobject-introspection glib playerctl python3.pkgs.pygobject3
|
|
|
|
libevdev libinput libjack2 libmpdclient playerctl libnl
|
|
|
|
libpulseaudio sndio sway libdbusmenu-gtk3 udev upower wireplumber
|
|
|
|
|
|
|
|
# from propagated build inputs?
|
|
|
|
at-spi2-atk atkmm cairo cairomm catch2 fmt_8 fontconfig
|
|
|
|
gdk-pixbuf glibmm gtk3 harfbuzz pango pangomm wayland-protocols
|
|
|
|
]);
|
2023-08-23 17:14:35 +00:00
|
|
|
|
2023-02-16 11:36:28 +00:00
|
|
|
env = with pkgs; [
|
|
|
|
{ name = "CPLUS_INCLUDE_PATH"; prefix = "$DEVSHELL_DIR/include"; }
|
|
|
|
{ name = "PKG_CONFIG_PATH"; prefix = "$DEVSHELL_DIR/lib/pkgconfig"; }
|
|
|
|
{ name = "PKG_CONFIG_PATH"; prefix = "$DEVSHELL_DIR/share/pkgconfig"; }
|
|
|
|
{ name = "PATH"; prefix = "${wayland.bin}/bin"; }
|
|
|
|
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib sndio}/lib"; }
|
|
|
|
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib zlib}/lib"; }
|
|
|
|
{ name = "LIBRARY_PATH"; prefix = "${lib.getLib howard-hinnant-date}/lib"; }
|
2022-12-06 17:44:26 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|