From 7096a5b9d069c29fc683e32ea5f06c2b2a1d3863 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Sat, 16 Oct 2021 12:51:46 +0100 Subject: [PATCH] Wayland support in flake.nix (#297) --- flake.nix | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index be6011d..83c0eb5 100644 --- a/flake.nix +++ b/flake.nix @@ -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; };