From 0cd40fed1370633cd38d2149e59bb7ba201e0d38 Mon Sep 17 00:00:00 2001 From: Gokul Swaminathan <33443763+JavaCafe01@users.noreply.github.com> Date: Wed, 16 Nov 2022 08:24:00 -0800 Subject: [PATCH] Fix Nix Flake (#50) * Override correct sway package * Update README.md * Remove unnecessary overlay * Improved shell --- README.md | 5 +++-- flake.nix | 46 +++++++--------------------------------------- 2 files changed, 10 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index ab342980..1cbd8673 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,11 @@ Sway is an incredible window manager, and certainly one of the most well establi ### Nix -If you have Nix installed, you can run SwayFX with a single command: +If you have Nix installed, you can build and run SwayFX easily: ``` -nix run github:WillPower3309/swayfx +nix build +./result/bin/sway ``` You can also bring up a development shell and follow the build instructions below, without installing all of the dependencies manually: diff --git a/flake.nix b/flake.nix index c0d745fb..880bf2c4 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,8 @@ outputs = { self, nixpkgs, flake-compat, ... }: let + inherit (nixpkgs) lib; + pkgsFor = system: import nixpkgs { inherit system; @@ -21,25 +23,21 @@ targetSystems = [ "aarch64-linux" "x86_64-linux" ]; in { overlays.default = final: prev: { - swayfx = prev.sway.overrideAttrs (old: { - version = "999-master"; - src = builtins.path { - name = "swayfx"; - path = prev.lib.cleanSource ./.; - }; - }); + swayfx-unwrapped = prev.sway-unwrapped.overrideAttrs + (old: { src = builtins.path { path = prev.lib.cleanSource ./.; }; }); }; packages = nixpkgs.lib.genAttrs targetSystems (system: let pkgs = pkgsFor system; in (self.overlays.default pkgs pkgs) // { - default = self.packages.${system}.swayfx; + default = self.packages.${system}.swayfx-unwrapped; }); devShells = nixpkgs.lib.genAttrs targetSystems (system: let pkgs = pkgsFor system; in { default = pkgs.mkShell { + name = "swayfx-shell"; depsBuildBuild = with pkgs; [ pkg-config ]; nativeBuildInputs = with pkgs; [ @@ -51,37 +49,7 @@ scdoc ]; - buildInputs = with pkgs; [ - wayland - libxkbcommon - pcre - json_c - libevdev - pango - cairo - libinput - libcap - pam - gdk-pixbuf - librsvg - wayland-protocols - libdrm - wlroots - dbus - xwayland - libGL - pixman - xorg.xcbutilwm - xorg.libX11 - libcap - xorg.xcbutilimage - xorg.xcbutilerrors - mesa - libpng - ffmpeg - xorg.xcbutilrenderutil - seatd - ]; + inputsFrom = [ self.packages.${system}.swayfx-unwrapped ]; }; }); };