when python meets nixos

This commit is contained in:
Aram Markarov
2026-02-14 17:03:35 +01:00
parent c5959c4d8e
commit 4286122a97
2 changed files with 63 additions and 56 deletions
+8 -5
View File
@@ -18,7 +18,12 @@
in {
formatter = forAllSystems (pkgs: pkgs.nixfmt);
packages = forAllSystems (pkgs: rec {
packages = forAllSystems (pkgs: let
pythonEnv = pkgs.python3.withPackages (ps: [
ps.pillow
ps.materialyoucolor
]);
in rec {
zshell = pkgs.callPackage ./nix {
rev = self.rev or self.dirtyRev;
stdenv = pkgs.clangStdenv;
@@ -27,6 +32,8 @@
withI3 = false;
};
app2unit = pkgs.callPackage ./nix/app2unit.nix {inherit pkgs;};
inherit pythonEnv;
};
default = zshell;
@@ -45,10 +52,6 @@
material-symbols
rubik
nerd-fonts.caskaydia-cove
(pkgs.python3.withPackages (python-pkgs: [
python-pkgs.pillow
python-pkgs.materialyoucolor
]))
];
};
});
+55 -51
View File
@@ -21,11 +21,12 @@
cmake,
ninja,
pkg-config,
}:
let
pythonEnv,
}: let
version = "1.0.0";
runtimeDeps = [
pythonEnv
app2unit
networkmanager
swappy
@@ -65,6 +66,7 @@ let
pkg-config
];
buildInputs = [
pythonEnv
qt6.qtbase
qt6.qtdeclarative
libqalculate
@@ -73,61 +75,63 @@ let
];
dontWrapQtApps = true;
cmakeFlags = [
(lib.cmakeFeature "ENABLE_MODULES" "plugin")
(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
]
++ cmakeVersionFlags;
cmakeFlags =
[
(lib.cmakeFeature "ENABLE_MODULES" "plugin")
(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
]
++ cmakeVersionFlags;
};
in
stdenv.mkDerivation {
inherit version cmakeBuildType;
pname = "zshell";
src = ./..;
stdenv.mkDerivation {
inherit version cmakeBuildType;
pname = "zshell";
src = ./..;
nativeBuildInputs = [
cmake
ninja
makeWrapper
qt6.wrapQtAppsHook
];
buildInputs = [
quickshell
plugin
qt6.qtbase
qt6.qtwayland
];
propagatedBuildInputs = runtimeDeps;
nativeBuildInputs = [
cmake
ninja
makeWrapper
qt6.wrapQtAppsHook
];
buildInputs = [
quickshell
plugin
qt6.qtbase
qt6.qtwayland
];
propagatedBuildInputs = runtimeDeps;
cmakeFlags = [
(lib.cmakeFeature "ENABLE_MODULES" "shell")
(lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/ZShell")
]
++ cmakeVersionFlags;
cmakeFlags =
[
(lib.cmakeFeature "ENABLE_MODULES" "shell")
(lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/ZShell")
]
++ cmakeVersionFlags;
prePatch = ''
substituteInPlace shell.qml \
--replace-fail 'ShellRoot {' 'ShellRoot { settings.watchFiles: false'
'';
prePatch = ''
substituteInPlace shell.qml \
--replace-fail 'ShellRoot {' 'ShellRoot { settings.watchFiles: false'
'';
postInstall = ''
makeWrapper ${quickshell}/bin/qs $out/bin/zshell \
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
--set FONTCONFIG_FILE "${fontconfig}" \
--add-flags "-p $out/share/ZShell"
postInstall = ''
makeWrapper ${quickshell}/bin/qs $out/bin/zshell \
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
--set FONTCONFIG_FILE "${fontconfig}" \
--add-flags "-p $out/share/ZShell"
echo "$out"
mkdir -p $out/lib
'';
echo "$out"
mkdir -p $out/lib
'';
passthru = {
inherit plugin;
};
passthru = {
inherit plugin;
};
meta = {
description = "A very segsy desktop shell";
homepage = "https://github.com/Zacharias-Brohn/z-bar-qt";
license = lib.licenses.gpl3Only;
mainProgram = "zshell";
};
}
meta = {
description = "A very segsy desktop shell";
homepage = "https://github.com/Zacharias-Brohn/z-bar-qt";
license = lib.licenses.gpl3Only;
mainProgram = "zshell";
};
}