Added flake support for wlroots subproject (#60)

This commit is contained in:
Gokul Swaminathan 2022-11-22 11:24:38 -08:00 committed by GitHub
parent 46378d4b69
commit d27c346b9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,8 +12,6 @@
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,7 +19,8 @@
}; };
targetSystems = [ "aarch64-linux" "x86_64-linux" ]; targetSystems = [ "aarch64-linux" "x86_64-linux" ];
in { in
{
overlays.default = final: prev: { overlays.default = final: prev: {
swayfx-unwrapped = prev.sway-unwrapped.overrideAttrs swayfx-unwrapped = prev.sway-unwrapped.overrideAttrs
(old: { src = builtins.path { path = prev.lib.cleanSource ./.; }; }); (old: { src = builtins.path { path = prev.lib.cleanSource ./.; }; });
@ -34,11 +33,14 @@
}); });
devShells = nixpkgs.lib.genAttrs targetSystems (system: devShells = nixpkgs.lib.genAttrs targetSystems (system:
let pkgs = pkgsFor system; let
in { pkgs = pkgsFor system;
in
{
default = pkgs.mkShell { default = pkgs.mkShell {
name = "swayfx-shell"; name = "swayfx-shell";
depsBuildBuild = with pkgs; [ pkg-config ]; depsBuildBuild = with pkgs; [ pkg-config ];
inputsFrom = [ self.packages.${system}.swayfx-unwrapped pkgs.wlroots ];
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
cmake cmake
@ -49,7 +51,11 @@
scdoc scdoc
]; ];
inputsFrom = [ self.packages.${system}.swayfx-unwrapped ]; shellHook = with pkgs; ''(
mkdir -p "$PWD/subprojects"
cd "$PWD/subprojects"
cp -R --no-preserve=mode,ownership ${wlroots.src} wlroots
)'';
}; };
}); });
}; };