Compare commits
2 Commits
60c1efb6a6
...
a853d5f7a7
| Author | SHA1 | Date |
|---|---|---|
|
|
a853d5f7a7 | |
|
|
d4efb33c25 |
61
flake.nix
61
flake.nix
|
|
@ -19,26 +19,71 @@
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
# do store-path extractions
|
||||||
|
qt6baseStorePath = lib.getLib pkgs.qt6.qtbase;
|
||||||
|
# ?TODO? can remove below since manual linking not needed?
|
||||||
|
# qt6QtWaylandStorePath = lib.getLib pkgs.qt6.qtwayland;
|
||||||
|
|
||||||
|
# XXX NOTE XXX, for now we overlay specific pkgs via
|
||||||
|
# a major-version-pinned-`cpython`
|
||||||
|
cpython = "python313";
|
||||||
|
pypkgs = pkgs."${cpython}Packages";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = [
|
|
||||||
pkgs.python313
|
packages = with pkgs; [
|
||||||
pkgs.uv
|
qt6.qtwayland
|
||||||
|
qt6.qtbase
|
||||||
|
|
||||||
|
uv
|
||||||
|
python313 # ?TODO^ how to set from `cpython` above?
|
||||||
|
pypkgs.pyqt6
|
||||||
|
pypkgs.pyqt6-sip
|
||||||
|
pypkgs.qtpy
|
||||||
|
pypkgs.qdarkstyle
|
||||||
|
pypkgs.rapidfuzz
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
unset PYTHONPATH
|
# unmask to debug **this** dev-shell-hook
|
||||||
|
# set -e
|
||||||
|
|
||||||
# expose C++ stdlib to overlay
|
# set qt-base/plugin path(s)
|
||||||
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH"
|
QTBASE_PATH="${qt6baseStorePath}/lib"
|
||||||
|
QT_PLUGIN_PATH="${qt6baseStorePath}/lib/qt-6/plugins"
|
||||||
|
QT_QPA_PLATFORM_PLUGIN_PATH="$QT_PLUGIN_PATH/platforms"
|
||||||
|
|
||||||
# always use the ./py313/ venv-subdir
|
# link in Qt cc lib paths from <nixpkgs>
|
||||||
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QTBASE_PATH"
|
||||||
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QT_PLUGIN_PATH"
|
||||||
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QT_QPA_PLATFORM_PLUGIN_PATH"
|
||||||
|
|
||||||
|
# link-in c++ stdlib for various AOT-ext-pkgs (numpy, etc.)
|
||||||
|
LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
# RUNTIME-SETTINGS
|
||||||
|
#
|
||||||
|
# ------ Qt ------
|
||||||
|
# XXX, unmask to debug qt .so linking/loading deats
|
||||||
|
# export QT_DEBUG_PLUGINS=1
|
||||||
|
#
|
||||||
|
# ALSO, for *modern linux* DEs,
|
||||||
|
# - maybe set wayland-mode (TODO, parametrtize this!)
|
||||||
|
# * a chosen wayland-mode shell-integration
|
||||||
|
export QT_QPA_PLATFORM="wayland"
|
||||||
|
export QT_WAYLAND_SHELL_INTEGRATION="xdg-shell"
|
||||||
|
|
||||||
|
# ------ uv ------
|
||||||
|
# - always use the ./py313/ venv-subdir
|
||||||
export UV_PROJECT_ENVIRONMENT="py313"
|
export UV_PROJECT_ENVIRONMENT="py313"
|
||||||
|
|
||||||
# sync project-env with all extras
|
# sync project-env with all extras
|
||||||
uv sync --dev --all-extras
|
uv sync --dev --all-extras
|
||||||
|
|
||||||
|
# ------ TIPS ------
|
||||||
# NOTE, to launch the py-venv installed `xonsh` (like @goodboy)
|
# NOTE, to launch the py-venv installed `xonsh` (like @goodboy)
|
||||||
# run the `nix develop` cmd with,
|
# run the `nix develop` cmd with,
|
||||||
# >> nix develop -c uv run xonsh
|
# >> nix develop -c uv run xonsh
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ def load(
|
||||||
MutableMapping,
|
MutableMapping,
|
||||||
] = tomllib.loads,
|
] = tomllib.loads,
|
||||||
|
|
||||||
touch_if_dne: bool = False,
|
touch_if_dne: bool = True,
|
||||||
|
|
||||||
**tomlkws,
|
**tomlkws,
|
||||||
|
|
||||||
|
|
@ -270,7 +270,7 @@ def load(
|
||||||
Load config file by name.
|
Load config file by name.
|
||||||
|
|
||||||
If desired config is not in the top level piker-user config path then
|
If desired config is not in the top level piker-user config path then
|
||||||
pass the ``path: Path`` explicitly.
|
pass the `path: Path` explicitly.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
# create the $HOME/.config/piker dir if dne
|
# create the $HOME/.config/piker dir if dne
|
||||||
|
|
@ -285,7 +285,8 @@ def load(
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not path.is_file()
|
not path.is_file()
|
||||||
and touch_if_dne
|
and
|
||||||
|
touch_if_dne
|
||||||
):
|
):
|
||||||
# only do a template if no path provided,
|
# only do a template if no path provided,
|
||||||
# just touch an empty file with same name.
|
# just touch an empty file with same name.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue