2022-12-06 17:44:26 +00:00
|
|
|
{
|
2024-01-08 15:38:05 +00:00
|
|
|
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
|
2022-12-06 17:44:26 +00:00
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
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-12-01 18:10:19 +00:00
|
|
|
outputs = { self, nixpkgs, ... }:
|
2022-12-06 17:44:26 +00:00
|
|
|
let
|
|
|
|
inherit (nixpkgs) lib;
|
2023-12-01 18:10:19 +00:00
|
|
|
genSystems = func: lib.genAttrs [
|
2022-12-06 17:44:26 +00:00
|
|
|
"x86_64-linux"
|
2023-09-19 13:50:39 +00:00
|
|
|
"aarch64-linux"
|
2024-01-08 15:38:05 +00:00
|
|
|
]
|
|
|
|
(system: func (import nixpkgs { inherit system; }));
|
2022-12-06 17:44:26 +00:00
|
|
|
|
|
|
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
|
|
|
(builtins.substring 0 4 longDate)
|
|
|
|
(builtins.substring 4 2 longDate)
|
|
|
|
(builtins.substring 6 2 longDate)
|
|
|
|
]);
|
|
|
|
in
|
|
|
|
{
|
2024-01-08 15:38:05 +00:00
|
|
|
devShells = genSystems
|
|
|
|
(pkgs:
|
|
|
|
{
|
|
|
|
default =
|
|
|
|
pkgs.mkShell
|
|
|
|
{
|
|
|
|
name = "waybar-shell";
|
|
|
|
|
|
|
|
# inherit attributes from upstream nixpkgs derivation
|
|
|
|
inherit (pkgs.waybar) buildInputs depsBuildBuild depsBuildBuildPropagated depsBuildTarget
|
|
|
|
depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget
|
|
|
|
depsTargetTargetPropagated propagatedBuildInputs propagatedNativeBuildInputs strictDeps;
|
|
|
|
|
|
|
|
# overrides for local development
|
|
|
|
nativeBuildInputs = pkgs.waybar.nativeBuildInputs ++ (with pkgs; [
|
|
|
|
clang-tools
|
|
|
|
gdb
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-05-03 06:31:39 +00:00
|
|
|
overlays = {
|
|
|
|
default = self.overlays.waybar;
|
|
|
|
waybar = final: prev: {
|
|
|
|
waybar = final.callPackage ./nix/default.nix {
|
|
|
|
waybar = prev.waybar;
|
|
|
|
# take the first "version: '...'" from meson.build
|
|
|
|
version =
|
|
|
|
(builtins.head (builtins.split "'"
|
|
|
|
(builtins.elemAt
|
|
|
|
(builtins.split " version: '" (builtins.readFile ./meson.build))
|
|
|
|
2)))
|
|
|
|
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
|
|
|
};
|
2022-12-06 17:44:26 +00:00
|
|
|
};
|
|
|
|
};
|
2024-01-08 15:38:05 +00:00
|
|
|
|
2024-05-03 06:31:39 +00:00
|
|
|
packages = genSystems (pkgs: {
|
|
|
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.waybar;
|
|
|
|
inherit (pkgs) waybar;
|
|
|
|
});
|
2024-01-08 15:38:05 +00:00
|
|
|
};
|
2022-12-06 17:44:26 +00:00
|
|
|
}
|