flake: update for swayfx 0.4 (#284)
This commit is contained in:
parent
40a5ebf109
commit
4b954d5a05
43
flake.lock
43
flake.lock
|
@ -2,11 +2,27 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712192574,
|
"lastModified": 1713349283,
|
||||||
"narHash": "sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5+ZwbYq4=",
|
"narHash": "sha256-2bjFu3+1zPWZPPGqF+7rumTvEwmdBHBhjPva/AMSruQ=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f480f9d09e4b4cf87ee6151eba068197125714de",
|
"rev": "2e359fb3162c85095409071d131e08252d91a14f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713128889,
|
||||||
|
"narHash": "sha256-aB90ZqzosyRDpBh+rILIcyP5lao8SKz8Sr2PSWvZrzk=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "2748d22b45a99fb2deafa5f11c7531c212b2cefa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -18,7 +34,26 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"scenefx": "scenefx"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scenefx": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713495445,
|
||||||
|
"narHash": "sha256-dMvGkhjt72NznwI57HLR+Oc6QMctf16W4zI1XYuwnZI=",
|
||||||
|
"owner": "wlrfx",
|
||||||
|
"repo": "scenefx",
|
||||||
|
"rev": "5ada125a56012923c47fcf3d049fab32eb7104ff",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "wlrfx",
|
||||||
|
"repo": "scenefx",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
101
flake.nix
101
flake.nix
|
@ -1,66 +1,75 @@
|
||||||
{
|
{
|
||||||
description = "Swayfx development environment";
|
description = "Swayfx development environment";
|
||||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
scenefx.url = "github:wlrfx/scenefx";
|
||||||
|
};
|
||||||
outputs =
|
outputs =
|
||||||
{ self, nixpkgs, ... }:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
scenefx,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
pkgsFor = system: import nixpkgs { inherit system; };
|
mkPackage = pkgs: {
|
||||||
|
swayfx-unwrapped =
|
||||||
|
(pkgs.swayfx-unwrapped.override { wlroots_0_16 = pkgs.wlroots_0_17; }).overrideAttrs
|
||||||
|
(old: {
|
||||||
|
version = "0.4.0-git";
|
||||||
|
src = pkgs.lib.cleanSource ./.;
|
||||||
|
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.cmake ];
|
||||||
|
buildInputs = old.buildInputs ++ [ pkgs.scenefx ];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
targetSystems = [
|
targetSystems = [
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
mkPackage = pkgs: {
|
pkgsFor =
|
||||||
swayfx-unwrapped =
|
system:
|
||||||
(pkgs.swayfx-unwrapped.override {
|
import nixpkgs {
|
||||||
# When the sway 1.9 rebase is finished, this will need to be overridden.
|
inherit system;
|
||||||
# wlroots_0_16 = pkgs.wlroots_0_16;
|
overlays = [ scenefx.overlays.insert ];
|
||||||
}).overrideAttrs
|
};
|
||||||
(old: {
|
forEachSystem = f: nixpkgs.lib.genAttrs targetSystems (system: f (pkgsFor system));
|
||||||
version = "0.3.2-git";
|
|
||||||
src = pkgs.lib.cleanSource ./.;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
overlays = rec {
|
overlays = rec {
|
||||||
default = insert;
|
default = insert;
|
||||||
# Override onto the input nixpkgs
|
# Insert using the locked nixpkgs. Can be used with any nixpkgs version.
|
||||||
override = _: prev: mkPackage prev;
|
|
||||||
# Insert using the locked nixpkgs
|
|
||||||
insert = _: prev: mkPackage (pkgsFor prev.system);
|
insert = _: prev: mkPackage (pkgsFor prev.system);
|
||||||
|
# Override onto the input nixpkgs. Users *MUST* have a scenefx overlay
|
||||||
|
# used before this overlay, otherwise pkgs.scenefx will be unavailable
|
||||||
|
override = _: prev: mkPackage prev;
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = nixpkgs.lib.genAttrs targetSystems (
|
packages = forEachSystem (
|
||||||
system: (mkPackage (pkgsFor system) // { default = self.packages.${system}.swayfx-unwrapped; })
|
pkgs: (mkPackage pkgs // { default = self.packages.${pkgs.system}.swayfx-unwrapped; })
|
||||||
);
|
);
|
||||||
|
|
||||||
devShells = nixpkgs.lib.genAttrs targetSystems (
|
devShells = forEachSystem (pkgs: {
|
||||||
system:
|
default = pkgs.mkShell {
|
||||||
let
|
name = "swayfx-shell";
|
||||||
pkgs = pkgsFor system;
|
inputsFrom = [
|
||||||
in
|
self.packages.${pkgs.system}.swayfx-unwrapped
|
||||||
{
|
pkgs.wlroots_0_17
|
||||||
default = pkgs.mkShell {
|
pkgs.scenefx
|
||||||
name = "swayfx-shell";
|
];
|
||||||
inputsFrom = [
|
packages = with pkgs; [
|
||||||
self.packages.${system}.swayfx-unwrapped
|
gdb # for debugging
|
||||||
pkgs.wlroots_0_17
|
];
|
||||||
];
|
shellHook = ''
|
||||||
nativeBuildInputs = with pkgs; [
|
(
|
||||||
cmake
|
# Copy the nix version of wlroots and scenefx into the project
|
||||||
wayland-scanner
|
mkdir -p "$PWD/subprojects" && cd "$PWD/subprojects"
|
||||||
hwdata # for wlroots
|
cp -R --no-preserve=mode,ownership ${pkgs.wlroots_0_17.src} wlroots
|
||||||
];
|
cp -R --no-preserve=mode,ownership ${pkgs.scenefx.src} scenefx
|
||||||
# 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_17.src} wlroots
|
|
||||||
)'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
formatter = nixpkgs.lib.genAttrs targetSystems (system: (pkgsFor system).nixfmt-rfc-style);
|
formatter = forEachSystem (pkgs: pkgs.nixfmt-rfc-style);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue