2022-04-28 04:31:46 +10:00
|
|
|
{
|
|
|
|
description = "swaywm development environment";
|
|
|
|
|
|
|
|
inputs = {
|
2022-11-16 14:47:04 +11:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2022-04-28 04:31:46 +10:00
|
|
|
};
|
|
|
|
|
2022-11-16 14:47:04 +11:00
|
|
|
outputs = { self, nixpkgs, flake-compat, ... }:
|
|
|
|
let
|
|
|
|
pkgsFor = system:
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ ];
|
2022-04-28 04:31:46 +10:00
|
|
|
};
|
2022-11-16 14:47:04 +11:00
|
|
|
|
|
|
|
targetSystems = [ "aarch64-linux" "x86_64-linux" ];
|
2022-11-23 06:24:38 +11:00
|
|
|
in
|
|
|
|
{
|
2022-11-16 14:47:04 +11:00
|
|
|
overlays.default = final: prev: {
|
2023-05-22 00:04:34 +10:00
|
|
|
swayfx-unwrapped = prev.sway-unwrapped.overrideAttrs (old: {
|
|
|
|
src = builtins.path { path = prev.lib.cleanSource ./.; };
|
|
|
|
patches =
|
|
|
|
let
|
|
|
|
removePatches = [
|
|
|
|
"LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM.patch"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
builtins.filter
|
|
|
|
(patch: !builtins.elem (patch.name or null) removePatches)
|
|
|
|
(old.patches or [ ]);
|
|
|
|
});
|
2022-11-16 14:47:04 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
packages = nixpkgs.lib.genAttrs targetSystems (system:
|
|
|
|
let pkgs = pkgsFor system;
|
|
|
|
in (self.overlays.default pkgs pkgs) // {
|
2022-11-17 03:24:00 +11:00
|
|
|
default = self.packages.${system}.swayfx-unwrapped;
|
2022-11-16 14:47:04 +11:00
|
|
|
});
|
|
|
|
|
|
|
|
devShells = nixpkgs.lib.genAttrs targetSystems (system:
|
2022-11-23 06:24:38 +11:00
|
|
|
let
|
|
|
|
pkgs = pkgsFor system;
|
|
|
|
in
|
|
|
|
{
|
2022-11-16 14:47:04 +11:00
|
|
|
default = pkgs.mkShell {
|
2022-11-17 03:24:00 +11:00
|
|
|
name = "swayfx-shell";
|
2022-11-16 14:47:04 +11:00
|
|
|
depsBuildBuild = with pkgs; [ pkg-config ];
|
2023-03-18 16:59:12 +11:00
|
|
|
inputsFrom = [ self.packages.${system}.swayfx-unwrapped pkgs.wlroots_0_16 ];
|
2022-11-16 14:47:04 +11:00
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
cmake
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
wayland-scanner
|
|
|
|
scdoc
|
2023-03-18 16:59:12 +11:00
|
|
|
hwdata # for wlroots
|
2022-11-16 14:47:04 +11:00
|
|
|
];
|
|
|
|
|
2022-11-23 06:24:38 +11:00
|
|
|
shellHook = with pkgs; ''(
|
|
|
|
mkdir -p "$PWD/subprojects"
|
|
|
|
cd "$PWD/subprojects"
|
2023-03-18 16:59:12 +11:00
|
|
|
cp -R --no-preserve=mode,ownership ${wlroots_0_16.src} wlroots
|
2022-11-23 06:24:38 +11:00
|
|
|
)'';
|
2022-11-16 14:47:04 +11:00
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
2022-04-28 04:31:46 +10:00
|
|
|
}
|