2022-04-28 04:31:46 +10:00
|
|
|
{
|
2024-04-10 14:58:34 +10:00
|
|
|
description = "Swayfx development environment";
|
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
outputs =
|
|
|
|
{ self, nixpkgs, ... }:
|
2022-11-16 14:47:04 +11:00
|
|
|
let
|
2024-04-10 14:58:34 +10:00
|
|
|
pkgsFor = system: import nixpkgs { inherit system; };
|
|
|
|
targetSystems = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
mkPackage = pkgs: {
|
|
|
|
swayfx-unwrapped =
|
|
|
|
(pkgs.swayfx-unwrapped.override {
|
|
|
|
# When the sway 1.9 rebase is finished, this will need to be overridden.
|
|
|
|
# wlroots_0_16 = pkgs.wlroots_0_16;
|
|
|
|
}).overrideAttrs
|
|
|
|
(old: {
|
|
|
|
version = "0.3.2-git";
|
|
|
|
src = pkgs.lib.cleanSource ./.;
|
|
|
|
});
|
|
|
|
};
|
2022-11-23 06:24:38 +11:00
|
|
|
in
|
|
|
|
{
|
2024-04-10 14:58:34 +10:00
|
|
|
overlays = rec {
|
|
|
|
default = override;
|
|
|
|
# Override onto the input nixpkgs
|
|
|
|
override = _: prev: mkPackage prev;
|
|
|
|
# Insert using the locked nixpkgs
|
|
|
|
insert = _: prev: mkPackage (pkgsFor prev.system);
|
2022-11-16 14:47:04 +11:00
|
|
|
};
|
|
|
|
|
2024-04-10 14:58:34 +10:00
|
|
|
packages = nixpkgs.lib.genAttrs targetSystems (
|
|
|
|
system: (mkPackage (pkgsFor system) // { default = self.packages.${system}.swayfx-unwrapped; })
|
|
|
|
);
|
2022-11-16 14:47:04 +11:00
|
|
|
|
2024-04-10 14:58:34 +10: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";
|
2024-04-10 14:58:34 +10:00
|
|
|
inputsFrom = [
|
|
|
|
self.packages.${system}.swayfx-unwrapped
|
|
|
|
pkgs.wlroots_0_16
|
|
|
|
];
|
2022-11-16 14:47:04 +11:00
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
cmake
|
|
|
|
wayland-scanner
|
|
|
|
];
|
2024-04-10 14:58:34 +10:00
|
|
|
# Copy the nix version of wlroots into the project
|
|
|
|
shellHook = with pkgs; ''
|
|
|
|
(
|
|
|
|
mkdir -p "$PWD/subprojects" && cd "$PWD/subprojects"
|
|
|
|
cp -R --no-preserve=mode,ownership ${wlroots_0_16.src} wlroots
|
|
|
|
)'';
|
2022-11-16 14:47:04 +11:00
|
|
|
};
|
2024-04-10 14:58:34 +10:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
formatter = nixpkgs.lib.genAttrs targetSystems (system: {
|
|
|
|
default = (pkgsFor system).nixfmt-rfc-style;
|
|
|
|
});
|
2022-11-16 14:47:04 +11:00
|
|
|
};
|
2022-04-28 04:31:46 +10:00
|
|
|
}
|