2021-11-20 01:36:34 +00:00
|
|
|
{
|
|
|
|
description = "sway/i3bar command in Rust";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2023-12-14 05:34:58 +00:00
|
|
|
outputs = { self, nixpkgs, utils }:
|
2023-12-11 01:10:14 +00:00
|
|
|
let supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
in (utils.lib.eachSystem supportedSystems (system:
|
2023-12-14 21:08:33 +00:00
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
dbusPaths = lib.makeSearchPathOutput "out" "share/dbus-1/interfaces"
|
|
|
|
(with pkgs; [ systemd ]);
|
2023-12-11 01:10:14 +00:00
|
|
|
in rec {
|
2023-12-14 05:34:58 +00:00
|
|
|
packages.rustybar = with pkgs;
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
name = "rustybar";
|
|
|
|
version = "0.1";
|
|
|
|
src = ./.;
|
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
doCheck = false;
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ dbus ];
|
2021-11-20 01:36:34 +00:00
|
|
|
|
2023-12-14 21:08:33 +00:00
|
|
|
DBUS_XML_PATH = dbusPaths;
|
|
|
|
|
2023-12-14 05:34:58 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/mildlyfunctionalgays/rustybar";
|
|
|
|
description = "swaybar/i3bar command in Rust";
|
|
|
|
maintainers = with maintainers; [ artemist ];
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
platforms = supportedSystems;
|
|
|
|
};
|
2021-11-20 01:36:34 +00:00
|
|
|
};
|
|
|
|
defaultPackage = packages.rustybar;
|
|
|
|
|
|
|
|
apps.rustybar = utils.lib.mkApp { drv = packages.rustybar; };
|
|
|
|
defaultApp = apps.rustybar;
|
|
|
|
|
2023-12-11 01:10:14 +00:00
|
|
|
devShells.rustybar = with pkgs;
|
|
|
|
mkShell {
|
|
|
|
packages = [
|
|
|
|
pkg-config
|
|
|
|
dbus
|
2023-12-12 20:40:27 +00:00
|
|
|
libfaketime
|
2023-12-14 05:34:58 +00:00
|
|
|
rustPackages.cargo
|
|
|
|
rustPackages.rustc
|
|
|
|
rustPackages.rustfmt
|
|
|
|
rustPackages.clippy
|
2023-12-11 01:10:14 +00:00
|
|
|
];
|
2023-12-14 21:08:33 +00:00
|
|
|
DBUS_XML_PATH = dbusPaths;
|
2023-12-14 05:34:58 +00:00
|
|
|
RUST_SRC_PATH =
|
|
|
|
"${rustPackages.rustPlatform.rustLibSrc}/lib/rustlib";
|
2023-12-11 01:10:14 +00:00
|
|
|
};
|
2021-11-20 01:36:34 +00:00
|
|
|
devShell = devShells.rustybar;
|
2023-12-11 01:10:14 +00:00
|
|
|
|
|
|
|
formatter = pkgs.nixfmt;
|
2021-11-20 03:50:10 +00:00
|
|
|
})) // {
|
2023-12-11 01:10:14 +00:00
|
|
|
overlays.default = final: prev: {
|
|
|
|
inherit (self.packages.${prev.system}) rustybar;
|
|
|
|
};
|
2021-11-20 03:50:10 +00:00
|
|
|
};
|
2021-11-20 01:36:34 +00:00
|
|
|
}
|