rustybar/flake.nix

60 lines
1.8 KiB
Nix

{
description = "sway/i3bar command in Rust";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
let supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
in (utils.lib.eachSystem supportedSystems (system:
let pkgs = import nixpkgs { inherit system; };
in rec {
packages.rustybar = with pkgs;
rustPlatform.buildRustPackage {
name = "rustybar";
version = "0.1";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
doCheck = false;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ dbus ];
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;
};
};
defaultPackage = packages.rustybar;
apps.rustybar = utils.lib.mkApp { drv = packages.rustybar; };
defaultApp = apps.rustybar;
devShells.rustybar = with pkgs;
mkShell {
packages = [
pkg-config
dbus
libfaketime
rustPackages.cargo
rustPackages.rustc
rustPackages.rustfmt
rustPackages.clippy
];
RUST_SRC_PATH =
"${rustPackages.rustPlatform.rustLibSrc}/lib/rustlib";
};
devShell = devShells.rustybar;
formatter = pkgs.nixfmt;
})) // {
overlays.default = final: prev: {
inherit (self.packages.${prev.system}) rustybar;
};
};
}