swayfx/flake.nix

74 lines
2 KiB
Nix
Raw Normal View History

2022-04-28 04:31:46 +10:00
{
description = "swaywm development environment";
inputs = {
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2022-04-28 04:31:46 +10:00
};
outputs = { self, nixpkgs, flake-compat, ... }:
let
pkgsFor = system:
import nixpkgs {
inherit system;
overlays = [ ];
2022-04-28 04:31:46 +10:00
};
targetSystems = [ "aarch64-linux" "x86_64-linux" ];
in
{
overlays.default = final: prev: {
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 [ ]);
});
};
packages = nixpkgs.lib.genAttrs targetSystems (system:
let pkgs = pkgsFor system;
in (self.overlays.default pkgs pkgs) // {
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 ];
2023-03-18 16:59:12 +11:00
inputsFrom = [ self.packages.${system}.swayfx-unwrapped pkgs.wlroots_0_16 ];
nativeBuildInputs = with pkgs; [
cmake
meson
ninja
pkg-config
wayland-scanner
scdoc
2023-03-18 16:59:12 +11:00
hwdata # for wlroots
];
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-04-28 04:31:46 +10:00
}