This commit is contained in:
atagen 2023-09-28 12:07:54 +10:00
parent 7a1488860b
commit b07d950147
27 changed files with 3330 additions and 169 deletions

167
flakes/qtile/flake.lock generated Normal file
View file

@ -0,0 +1,167 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1693611461,
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1693611461,
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1695644571,
"narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1693471703,
"narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1693471703,
"narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1695644571,
"narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pywlroots": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_2",
"pywlroots-src": "pywlroots-src"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-W8zExI9+M6/4XcyncAFpnLvr+lNgDXMTZ1Nfb6JtkIU=",
"path": "pywlroots",
"type": "path"
},
"original": {
"path": "pywlroots",
"type": "path"
}
},
"pywlroots-src": {
"flake": false,
"locked": {
"lastModified": 1694810594,
"narHash": "sha256-TjOYziToYqXbhAK+h/h00/e7oPluDsGaBP3DJ68jPXM=",
"owner": "flacjacket",
"repo": "pywlroots",
"rev": "fca5c8142930ed4a6c23a906e77813207d993480",
"type": "github"
},
"original": {
"owner": "flacjacket",
"repo": "pywlroots",
"type": "github"
}
},
"qtile-src": {
"flake": false,
"locked": {
"lastModified": 1695682843,
"narHash": "sha256-8Dqe2OoFND6n9d++uxgEcUffVT8V5/g9fXqszJ/IpEU=",
"owner": "qtile",
"repo": "qtile",
"rev": "ad5d0538c51c7ba57ef8520b45b2728fe6caa3a3",
"type": "github"
},
"original": {
"owner": "qtile",
"repo": "qtile",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"pywlroots": "pywlroots",
"qtile-src": "qtile-src"
}
}
},
"root": "root",
"version": 7
}

80
flakes/qtile/flake.nix Normal file
View file

@ -0,0 +1,80 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
qtile-src = {
url = "github:qtile/qtile";
flake = false;
};
pywlroots = {
url = "path:pywlroots";
};
};
outputs = inputs@{ flake-parts, qtile-src, pywlroots, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ...}: {
packages.qtile = with pkgs; with pkgs.python3Packages; buildPythonPackage rec {
pname = "qtile";
version = "unstable-${inputs.qtile-src.lastModifiedDate}";
src = inputs.qtile-src;
SETUPTOOLS_SCM_PRETEND_VERSION = "0.23.0";
postPatch = ''
substituteInPlace libqtile/pangocffi.py \
--replace libgobject-2.0.so.0 ${pkgs.glib.out}/lib/libgobject-2.0.so.0 \
--replace libpangocairo-1.0.so.0 ${pkgs.pango.out}/lib/libpangocairo-1.0.so.0 \
--replace libpango-1.0.so.0 ${pkgs.pango.out}/lib/libpango-1.0.so.0
substituteInPlace libqtile/backend/x11/xcursors.py \
--replace libxcb-cursor.so.0 ${pkgs.xcb-util-cursor.out}/lib/libxcb-cursor.so.0
substituteInPlace libqtile/backend/wayland/cffi/cairo_buffer.py \
--replace drm_fourcc.h libdrm/drm_fourcc.h
substituteInPlace libqtile/backend/wayland/cffi/build.py \
--replace /usr/include/pixman-1 ${lib.getDev pkgs.pixman}/include \
--replace /usr/include/libdrm ${lib.getDev pkgs.libdrm}/include/libdrm
'';
nativeBuildInputs = [
pkg-config
setuptools-scm
setuptools
];
propagatedBuildInputs = [
xcffib
(cairocffi.override { withXcffib = true; })
python-dateutil
dbus-python
dbus-next
mpd2
psutil
pulsectl-asyncio
pyxdg
pygobject3
pywayland
inputs'.pywlroots.packages.default
xkbcommon
];
buildInputs = [
libinput
libxkbcommon
libdrm
wayland
xorg.xcbutilwm
(wlroots.overrideAttrs (wf: wp: {
postPatch =
wp.postPatch
+ ''
substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();"
'';
}))
];
makeWrapperArgs = [
"--suffix PATH : ${lib.makeBinPath [ mypy ]}"
];
doCheck = false;
};
};
};
}

81
flakes/qtile/pywlroots/flake.lock generated Normal file
View file

@ -0,0 +1,81 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1693611461,
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1695644571,
"narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1693471703,
"narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pywlroots-src": {
"flake": false,
"locked": {
"lastModified": 1694810594,
"narHash": "sha256-TjOYziToYqXbhAK+h/h00/e7oPluDsGaBP3DJ68jPXM=",
"owner": "flacjacket",
"repo": "pywlroots",
"rev": "fca5c8142930ed4a6c23a906e77813207d993480",
"type": "github"
},
"original": {
"owner": "flacjacket",
"repo": "pywlroots",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"pywlroots-src": "pywlroots-src"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,49 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pywlroots-src = {
url = "github:flacjacket/pywlroots";
flake = false;
};
};
outputs = inputs@{ flake-parts, pywlroots-src, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ...}: {
packages.default = with pkgs; with pkgs.python3Packages; buildPythonPackage rec {
pname = "pywlroots";
version = "unstable-${inputs.pywlroots-src.lastModifiedDate}";
format = "setuptools";
disable = pythonOlder "3.7";
src = inputs.pywlroots-src;
nativeBuildInputs = [ pkg-config ];
propagatedNativeBuildInputs = [ cffi ];
buildInputs = [ libinput libxkbcommon pixman xorg.libxcb xorg.xcbutilwm udev wayland
((wlroots_0_16.override {xwayland = xwayland; enableXWayland = true;}).overrideAttrs (wf: wp: {
postPatch =
wp.postPatch
+ ''
substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();"
'';
}))
];
propagatedBuildInputs = [ cffi pywayland xkbcommon
];
nativeCheckInputs = [ pytestCheckHook ];
postBuild = ''
${python3.pythonForBuild.interpreter} wlroots/ffi_build.py
'';
pythonImportsCheck = [ "wlroots" ];
passthru.test = { inherit qtile; };
};
};
}; #/mkFlake
}