diff --git a/projects/khora/.envrc b/projects/khora/.envrc new file mode 100644 index 00000000..e8ff23c0 --- /dev/null +++ b/projects/khora/.envrc @@ -0,0 +1 @@ +use flake .#khora diff --git a/projects/khora/README.md b/projects/khora/README.md index 51d8c3b5..ec23c5e0 100644 --- a/projects/khora/README.md +++ b/projects/khora/README.md @@ -28,6 +28,13 @@ nix build .#khora nix run .#khora ``` +For a faster development loop, enter `projects/khora` and let direnv load its +Khora development shell, then run the source tree directly: + +```sh +python -m khora +``` + Khora reads the same XDG configuration and vdirs as khal. It does not configure accounts or perform network synchronization. diff --git a/projects/khora/default.nix b/projects/khora/default.nix index 3cee921b..195385ef 100644 --- a/projects/khora/default.nix +++ b/projects/khora/default.nix @@ -3,6 +3,7 @@ python3Packages, khal, gobject-introspection, + gsettings-desktop-schemas, gtk4, libadwaita, wrapGAppsHook4, @@ -16,8 +17,9 @@ python3Packages.buildPythonApplication { root = ./.; fileset = lib.fileset.unions [ ./data + ./README.md ./pyproject.toml - ./src + ./khora ./tests ]; }; @@ -38,6 +40,10 @@ python3Packages.buildPythonApplication { ]; nativeCheckInputs = [python3Packages.pytestCheckHook]; + shellHook = '' + export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk4}/share/gsettings-schemas/${gtk4.name}:$XDG_DATA_DIRS" + ''; + postInstall = '' install -Dm644 data/rs.m7.Khora.desktop \ $out/share/applications/rs.m7.Khora.desktop diff --git a/projects/khora/src/khora/__init__.py b/projects/khora/khora/__init__.py similarity index 100% rename from projects/khora/src/khora/__init__.py rename to projects/khora/khora/__init__.py diff --git a/projects/khora/src/khora/__main__.py b/projects/khora/khora/__main__.py similarity index 100% rename from projects/khora/src/khora/__main__.py rename to projects/khora/khora/__main__.py diff --git a/projects/khora/src/khora/application.py b/projects/khora/khora/application.py similarity index 100% rename from projects/khora/src/khora/application.py rename to projects/khora/khora/application.py diff --git a/projects/khora/src/khora/colors.py b/projects/khora/khora/colors.py similarity index 100% rename from projects/khora/src/khora/colors.py rename to projects/khora/khora/colors.py diff --git a/projects/khora/src/khora/khal_adapter.py b/projects/khora/khora/khal_adapter.py similarity index 100% rename from projects/khora/src/khora/khal_adapter.py rename to projects/khora/khora/khal_adapter.py diff --git a/projects/khora/src/khora/model.py b/projects/khora/khora/model.py similarity index 100% rename from projects/khora/src/khora/model.py rename to projects/khora/khora/model.py diff --git a/projects/khora/src/khora/window.py b/projects/khora/khora/window.py similarity index 100% rename from projects/khora/src/khora/window.py rename to projects/khora/khora/window.py diff --git a/projects/khora/pyproject.toml b/projects/khora/pyproject.toml index 887f2684..456e23bd 100644 --- a/projects/khora/pyproject.toml +++ b/projects/khora/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ khora = "khora.application:main" [tool.setuptools.packages.find] -where = ["src"] +include = ["khora*"] [tool.pytest.ini_options] testpaths = ["tests"]