Drop Poetry and cleanup flake.nix
Version Control Information
Source branch: change/drop-poetry
Target branch: devel
Commits:
* Group dependencies in curly braces
* test: test direnv setup in ci
Previously, the container image was built with all dependencies in PATH
which meant that inside of it, YAOOK/K8s could be used out-of-the-box.
This may be desirable for images targeted at interactive use, but for
the CI it means that the direnv setup cannot be properly tested.
This commit changes the container image so that is is built with all
dependencies available in the Nix store but not in PATH.
* Fix minimal package group
This commit moves iproute2 and wireguard-tools from the default to the
minimal group, because they are needed for wg-up.sh.
* Move CI package definitions to own module
Defining Nix dependencies in a Flake module allows us to move the CI
image definition into its own module as well, further cleaning up
flake.nix and increasing separation of concerns.
* Move Nix template definition to own module
This commit moves the definition of Nix templates to their own module in
order to make flake.nix more concise.
* Render docs as package
Defining all dependencies in Nix allows us to generate the whole
documentation directly in Nix as well.
The documentation can now be built with
nix build .#docs
* pre-commit: Fix exclude rule for trailing-whitespace hook
* Drop poetry
After dropping poetry2nix and going back to the pure Poetry direnv
layout, we are back to its drawbacks including impure builds, the
occasional hard-to-debug "it works on my machine" build error, problems
with the keychain and most importantly lengthy package installations
with non-ideal deduplication.
This commit implements option 4 as discussed in [1]. It drops all Poetry
usage from the repository and adds all Python dependencies via nixpkgs
directly.
One exception is kubernetes-validate which has been submitted to
nixpkgs[2]. Until it's accepted, its package definition is added to
this repository.
With all Python dependencies defined in Nix, the CI image contains
everything that is needed to run YAOOK/K8s. Thus, this commit also drops
the direnv invocations in the CI, speeding up runs which won't have to
download Python packages anymore.
[1] https://gitlab.com/yaook/k8s/-/issues/723
[2] https://github.com/NixOS/nixpkgs/pull/356174
* Drop python-neutronclient
python-neutronclient was a dependency of terraform_migrate.py which was
dropped in c0be6c50dac3dfe102777b777480205cb525bae7. This commit removes
this remnant.
* Drop offline-installation dependency group
Support for air gapped installations has been dropped with v4.0.0. This
commit removes the offline-installation dependency group which serves no
purpose anymore.
* flake.lock: Update
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53' (2024-10-30)
→ 'github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7' (2024-11-18)
* Rework requirements + devShells
When the flake.nix was introduced in this repository, its only purpose
was the then-optional devShell with a couple of dependencies. We have
since
* completed the dependency listing to be exhaustive
* introduced multiple dependency groups (minimal, ci, interactive)
* started to build the CI image using Nix
* migrated to a Nix based configuration.
All of this has made the flake.nix file quite lengthy over time, which
should be a concise and overseable entry-point. Also, the different
groups are each treated specially, which ideally should not be the case.
This commit introduces a new Flake module yk8s-env which allows to
define dependency groups as a DAG. Each dependency group will produce
its own output package and devShell to be consumed by the direnv layout
or other Nix expressions.
* Drop poetry2nix
poetry2nix is now unmaintained
https://github.com/nix-community/poetry2nix/commit/f554d27c1544d9c56e5f1f8e2b8aff399803674e
Also, maintaining its overrides that would regularly get out of sync
with PyPI has become a bit of a burden.
This commit removes poetry2nix from this repository and re-enables the
old poetry direnv layout.
Close #723
Description
As decided in #723 (comment 2222568303), this change completely drops poetry including poetry2nix and switches to Nix as the sole dependency and environment manager using pure nix pure nixpkgs dependencies only.
With that, some parts in flake.nix are outsourced and consolidated so that it becomes more concise.
Closes: #723 (closed)
Notes
This MR is best reviewed on a per-commit basis.
Merge Prerequisites
-
MR title (and description) are descriptive -
Code is readable and syntactically correct -
Code is understandable -
Documentation has been updated, if necessary -
Commit messages look good -
Release note file in RST format added in latest commit
Edited by brunos