Files
pkgmgr/flake.nix

133 lines
3.8 KiB
Nix
Raw Normal View History

{
description = "Nix flake for Kevin's package-manager tool";
nixConfig = {
extra-experimental-features = [ "nix-command" "flakes" ];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = f:
builtins.listToAttrs (map (system: {
name = system;
value = f system;
}) systems);
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
in
{
##########################################################################
# PACKAGES
##########################################################################
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Single source of truth for pkgmgr: Python 3.11
# - Matches pyproject.toml: requires-python = ">=3.11"
# - Uses python311Packages so that PyYAML etc. are available
python = pkgs.python311;
pyPkgs = pkgs.python311Packages;
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
in
rec {
pkgmgr = pyPkgs.buildPythonApplication {
pname = "package-manager";
2025-12-12 23:06:15 +01:00
version = "1.4.1";
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
# Use the git repo as source
src = ./.;
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
# Build using pyproject.toml
format = "pyproject";
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
# Build backend requirements from [build-system]
nativeBuildInputs = [
pyPkgs.setuptools
pyPkgs.wheel
];
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
# Runtime dependencies (matches [project.dependencies] in pyproject.toml)
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
propagatedBuildInputs = [
pyPkgs.pyyaml
pyPkgs.pip
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
];
doCheck = false;
pythonImportsCheck = [ "pkgmgr" ];
};
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
default = pkgmgr;
}
);
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
##########################################################################
# DEVELOPMENT SHELL
##########################################################################
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ansiblePkg =
if pkgs ? ansible-core then pkgs.ansible-core
else pkgs.ansible;
# Use the same Python version as the package (3.11)
python = pkgs.python311;
pythonWithDeps = python.withPackages (ps: [
ps.pip
ps.pyyaml
]);
in
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
{
default = pkgs.mkShell {
buildInputs = [
pythonWithDeps
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
pkgs.git
ansiblePkg
];
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
shellHook = ''
# Ensure our Python with dependencies is preferred on PATH
export PATH=${pythonWithDeps}/bin:$PATH
# Ensure src/ layout is importable:
# pkgmgr lives in ./src/pkgmgr
export PYTHONPATH="$PWD/src:${PYTHONPATH:-}"
# Also add repo root in case tools/tests rely on it
export PYTHONPATH="$PWD:$PYTHONPATH"
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
echo "Entered pkgmgr development shell for ${system}"
echo "Python used in this shell:"
python --version
echo "pkgmgr CLI (from source) is available via:"
echo " python -m pkgmgr.cli --help"
'';
};
}
);
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
##########################################################################
# nix run .#pkgmgr
##########################################################################
apps = forAllSystems (system:
let
pkgmgrPkg = self.packages.${system}.pkgmgr;
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
in
{
pkgmgr = {
type = "app";
program = "${pkgmgrPkg}/bin/pkgmgr";
};
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
default = self.apps.${system}.pkgmgr;
}
);
};
}