modularise home conf

This commit is contained in:
atagen 2023-09-28 13:15:38 +10:00
parent b07d950147
commit 4477d0d4a2
23 changed files with 1152 additions and 855 deletions

View file

@ -15,48 +15,53 @@
};
};
outputs = { self, nixpkgs, crane, flake-utils, kile-src, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# import nixpkgs {
# inherit system;
# };
outputs = {
self,
nixpkgs,
crane,
flake-utils,
kile-src,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
# import nixpkgs {
# inherit system;
# };
craneLib = crane.lib.${system};
kile = craneLib.buildPackage {
src = kile-src;
craneLib = crane.lib.${system};
kile = craneLib.buildPackage {
src = kile-src;
buildInputs = with pkgs; [
wayland
];
buildInputs = with pkgs; [
wayland
];
# Additional environment variables can be set directly
# MY_CUSTOM_VAR = "some value";
};
in
{
checks = {
inherit kile;
};
# Additional environment variables can be set directly
# MY_CUSTOM_VAR = "some value";
};
in {
checks = {
inherit kile;
};
packages.default = kile;
packages.default = kile;
apps.default = flake-utils.lib.mkApp {
drv = kile;
};
apps.default = flake-utils.lib.mkApp {
drv = kile;
};
devShells.default = craneLib.devShell {
# Inherit inputs from checks.
checks = self.checks.${system};
devShells.default = craneLib.devShell {
# Inherit inputs from checks.
checks = self.checks.${system};
# Additional dev-shell environment variables can be set directly
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
# Additional dev-shell environment variables can be set directly
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
# Extra inputs can be added here; cargo and rustc are provided by default.
packages = [
# pkgs.ripgrep
];
};
});
# Extra inputs can be added here; cargo and rustc are provided by default.
packages = [
# pkgs.ripgrep
];
};
});
}

View file

@ -1,80 +1,94 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.url = "github:hercules-ci/flake-parts";
qtile-src = {
url = "github:qtile/qtile";
flake = false;
};
pywlroots = {
url = "path:pywlroots";
};
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;
};
};
};
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;
};
};
};
}

View file

@ -2,48 +2,73 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
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;
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
'';
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
pythonImportsCheck = ["wlroots"];
passthru.test = {inherit qtile;};
};
};
}; #/mkFlake
}