Wayland support in flake.nix (#297)

This commit is contained in:
Adam Washington 2021-10-16 12:51:46 +01:00 committed by GitHub
parent 90466ab9bf
commit 7096a5b9d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,22 +23,23 @@
rustc = pkgs.rustc;
});
eww = naersk-lib.buildPackage {
pname = "eww";
nativeBuildInputs = with pkgs; [ pkg-config gtk3 ];
root = ./.;
};
eww = { wayland ? false }:
naersk-lib.buildPackage {
pname = "eww";
buildInputs = pkgs.lib.optional wayland pkgs.gtk-layer-shell;
nativeBuildInputs = with pkgs; [ pkg-config gtk3 ];
cargoBuildOptions = opts: opts ++ pkgs.lib.optionals wayland [ "--no-default-features" "--features=wayland" ];
root = ./.;
};
in rec {
packages.eww = eww {};
packages.eww-wayland = eww {wayland=true;};
in
rec {
packages.eww = eww;
defaultPackage = self.packages.${system}.eww;
defaultPackage = eww;
apps.eww = flake-utils.lib.mkApp {
drv = eww;
};
apps.eww = flake-utils.lib.mkApp { drv = packages.eww; };
apps.eww-wayland = flake-utils.lib.mkApp { drv = packages.eww-wayland; };
defaultApp = apps.eww;
devShell = import ./shell.nix { inherit pkgs; };