2021-07-11 17:03:03 +03:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-02-24 15:46:40 +03:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-08-22 00:09:54 +03:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2024-02-24 15:46:40 +03:00
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2021-07-11 17:03:03 +03:00
|
|
|
};
|
|
|
|
|
2024-02-24 15:46:40 +03:00
|
|
|
outputs = { self, nixpkgs, rust-overlay, flake-compat }:
|
2022-08-22 00:09:54 +03:00
|
|
|
let
|
2024-02-24 15:46:40 +03:00
|
|
|
pkgsFor = system:
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlays.default rust-overlay.overlays.default ];
|
|
|
|
};
|
2022-08-15 11:56:05 +03:00
|
|
|
|
2022-08-22 00:09:54 +03:00
|
|
|
targetSystems = [ "aarch64-linux" "x86_64-linux" ];
|
2024-02-24 15:46:40 +03:00
|
|
|
mkRustToolchain = pkgs:
|
|
|
|
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
|
|
|
in {
|
2022-08-22 00:09:54 +03:00
|
|
|
overlays.default = final: prev:
|
|
|
|
let
|
|
|
|
rust = mkRustToolchain final;
|
2022-08-15 11:56:05 +03:00
|
|
|
|
2022-08-22 00:09:54 +03:00
|
|
|
rustPlatform = prev.makeRustPlatform {
|
|
|
|
cargo = rust;
|
|
|
|
rustc = rust;
|
2022-08-15 11:56:05 +03:00
|
|
|
};
|
2024-02-24 15:46:40 +03:00
|
|
|
in {
|
|
|
|
eww = (prev.eww.override { inherit rustPlatform; }).overrideAttrs
|
|
|
|
(old: {
|
|
|
|
version = self.rev or "dirty";
|
|
|
|
src = builtins.path {
|
|
|
|
name = "eww";
|
|
|
|
path = prev.lib.cleanSource ./.;
|
|
|
|
};
|
|
|
|
cargoDeps =
|
|
|
|
rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
|
|
|
|
patches = [ ];
|
2024-03-30 12:55:01 +03:00
|
|
|
# remove this when nixpkgs includes it
|
|
|
|
buildInputs = old.buildInputs ++ [ final.libdbusmenu-gtk3 ];
|
2024-02-24 15:46:40 +03:00
|
|
|
});
|
2022-08-15 11:56:05 +03:00
|
|
|
|
2024-02-24 15:46:40 +03:00
|
|
|
eww-wayland = final.eww;
|
2022-08-15 11:56:05 +03:00
|
|
|
};
|
|
|
|
|
2022-08-22 00:09:54 +03:00
|
|
|
packages = nixpkgs.lib.genAttrs targetSystems (system:
|
2024-02-24 15:46:40 +03:00
|
|
|
let pkgs = pkgsFor system;
|
|
|
|
in (self.overlays.default pkgs pkgs) // {
|
2022-08-22 00:09:54 +03:00
|
|
|
default = self.packages.${system}.eww;
|
2024-02-24 15:46:40 +03:00
|
|
|
});
|
2022-08-15 11:56:05 +03:00
|
|
|
|
2022-08-22 00:09:54 +03:00
|
|
|
devShells = nixpkgs.lib.genAttrs targetSystems (system:
|
|
|
|
let
|
|
|
|
pkgs = pkgsFor system;
|
|
|
|
rust = mkRustToolchain pkgs;
|
2024-02-24 15:46:40 +03:00
|
|
|
in {
|
2022-08-22 00:09:54 +03:00
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
rust
|
|
|
|
rust-analyzer-unwrapped
|
2022-08-15 11:56:05 +03:00
|
|
|
gcc
|
2024-03-30 12:55:01 +03:00
|
|
|
glib
|
|
|
|
gdk-pixbuf
|
|
|
|
librsvg
|
|
|
|
libdbusmenu-gtk3
|
2022-08-15 11:56:05 +03:00
|
|
|
gtk3
|
|
|
|
gtk-layer-shell
|
|
|
|
pkg-config
|
|
|
|
deno
|
2022-08-22 00:09:54 +03:00
|
|
|
mdbook
|
|
|
|
];
|
2021-07-11 17:03:03 +03:00
|
|
|
|
2022-08-22 00:09:54 +03:00
|
|
|
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
|
|
|
|
};
|
2024-02-24 15:46:40 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
formatter =
|
|
|
|
nixpkgs.lib.genAttrs targetSystems (system: (pkgsFor system).nixfmt);
|
2022-08-22 00:09:54 +03:00
|
|
|
};
|
2021-07-11 17:03:03 +03:00
|
|
|
}
|