Files
pkgmgr/flake.nix
Kevin Veen-Birkenbach 7760c77952 Use pyproject-based Nix flake build and fix install logic for pkgmgr
- Add pyproject.toml to define package-manager as a Python application
  - Declare setuptools build backend (setuptools.build_meta) and wheel
  - Expose CLI entrypoint via [project.scripts] as `pkgmgr = pkgmgr.cli:main`
  - Define PyYAML as a base runtime dependency

- Update flake.nix to build pkgmgr via python311Packages.buildPythonApplication
  - Use format = "pyproject" and src = ./. (current git checkout)
  - Add setuptools and wheel to nativeBuildInputs for the backend
  - Add pyyaml to propagatedBuildInputs to match pyproject dependencies
  - Provide a devShell that includes the built pkgmgr, git, and Ansible
  - Expose `nix run .#pkgmgr` and `nix run .#default` as flake apps

- Fix Makefile install target for Nix shells
  - Treat install as a no-op when IN_NIX_SHELL is set (skip venv / pip)
  - In non-Nix environments, create ~/.venvs/pkgmgr, install deps, and
    wire automatic activation into shell rc files
  - Keep Arch/Manjaro-specific aur_builder/yay setup behind pacman check

- Adjust PKGBUILD prepare() to correctly copy the full project tree
  - Stop excluding the top-level src directory from rsync
  - Still exclude .git, .github, pkg, and srcpkg

This unifies the installation workflow across Arch, Nix, and local venvs,
and ensures pkgmgr builds cleanly inside the Docker-based Nix devShell tests.

Reference: ChatGPT-assisted refactor & debugging session on 2025-12-07.
https://chatgpt.com/share/6935ee1f-6c0c-800f-bb32-434c4051bd1e
2025-12-07 22:14:29 +01:00

2.9 KiB