Fix Nix Flake (#50)

* Override correct sway package

* Update README.md

* Remove unnecessary overlay

* Improved shell
This commit is contained in:
Gokul Swaminathan 2022-11-16 08:24:00 -08:00 committed by GitHub
parent fa6164f8fb
commit 0cd40fed13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 41 deletions

View file

@ -25,10 +25,11 @@ Sway is an incredible window manager, and certainly one of the most well establi
### Nix ### 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: You can also bring up a development shell and follow the build instructions below, without installing all of the dependencies manually:

View file

@ -12,6 +12,8 @@
outputs = { self, nixpkgs, flake-compat, ... }: outputs = { self, nixpkgs, flake-compat, ... }:
let let
inherit (nixpkgs) lib;
pkgsFor = system: pkgsFor = system:
import nixpkgs { import nixpkgs {
inherit system; inherit system;
@ -21,25 +23,21 @@
targetSystems = [ "aarch64-linux" "x86_64-linux" ]; targetSystems = [ "aarch64-linux" "x86_64-linux" ];
in { in {
overlays.default = final: prev: { overlays.default = final: prev: {
swayfx = prev.sway.overrideAttrs (old: { swayfx-unwrapped = prev.sway-unwrapped.overrideAttrs
version = "999-master"; (old: { src = builtins.path { path = prev.lib.cleanSource ./.; }; });
src = builtins.path {
name = "swayfx";
path = prev.lib.cleanSource ./.;
};
});
}; };
packages = nixpkgs.lib.genAttrs targetSystems (system: packages = nixpkgs.lib.genAttrs targetSystems (system:
let pkgs = pkgsFor system; let pkgs = pkgsFor system;
in (self.overlays.default pkgs pkgs) // { in (self.overlays.default pkgs pkgs) // {
default = self.packages.${system}.swayfx; default = self.packages.${system}.swayfx-unwrapped;
}); });
devShells = nixpkgs.lib.genAttrs targetSystems (system: devShells = nixpkgs.lib.genAttrs targetSystems (system:
let pkgs = pkgsFor system; let pkgs = pkgsFor system;
in { in {
default = pkgs.mkShell { default = pkgs.mkShell {
name = "swayfx-shell";
depsBuildBuild = with pkgs; [ pkg-config ]; depsBuildBuild = with pkgs; [ pkg-config ];
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
@ -51,37 +49,7 @@
scdoc scdoc
]; ];
buildInputs = with pkgs; [ inputsFrom = [ self.packages.${system}.swayfx-unwrapped ];
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
];
}; };
}); });
}; };