nyl 0.5.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. nyl-0.6.0/.github/workflows/docs.yaml +38 -0
  2. nyl-0.6.0/.github/workflows/python.yaml +59 -0
  3. {nyl-0.5.0 → nyl-0.6.0}/.gitignore +1 -0
  4. {nyl-0.5.0 → nyl-0.6.0}/PKG-INFO +11 -1
  5. {nyl-0.5.0 → nyl-0.6.0}/README.md +10 -0
  6. {nyl-0.5.0 → nyl-0.6.0}/argocd-cmp/Dockerfile +11 -7
  7. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/configuration-api/secrets.md +5 -0
  8. nyl-0.6.0/flake.lock +348 -0
  9. nyl-0.6.0/flake.nix +113 -0
  10. nyl-0.6.0/nix/uv.nix +41 -0
  11. {nyl-0.5.0 → nyl-0.6.0}/pyproject.toml +3 -1
  12. nyl-0.6.0/renovate.json +34 -0
  13. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/project/config.py +14 -0
  14. {nyl-0.5.0 → nyl-0.6.0}/uv.lock +66 -0
  15. nyl-0.5.0/.github/workflows/docs.yaml +0 -36
  16. nyl-0.5.0/.github/workflows/python.yaml +0 -78
  17. nyl-0.5.0/.kraken.py +0 -7
  18. {nyl-0.5.0 → nyl-0.6.0}/.envrc +0 -0
  19. {nyl-0.5.0 → nyl-0.6.0}/.github/workflows/docker.yaml +0 -0
  20. {nyl-0.5.0 → nyl-0.6.0}/argocd-cmp/README.md +0 -0
  21. {nyl-0.5.0 → nyl-0.6.0}/argocd-cmp/plugin.yaml +0 -0
  22. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/.envrc +0 -0
  23. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/.secrets.yaml +0 -0
  24. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/.sops.yaml +0 -0
  25. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/README.md +0 -0
  26. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/argocd.yaml +0 -0
  27. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/nyl-project.yaml +0 -0
  28. {nyl-0.5.0 → nyl-0.6.0}/argocd-with-nyl/nyl-secrets.yaml +0 -0
  29. {nyl-0.5.0 → nyl-0.6.0}/docs/content/index.md +0 -0
  30. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/applysets.md +0 -0
  31. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/argocd-plugin.md +0 -0
  32. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/cluster-connectivity.md +0 -0
  33. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/configuration/environment.md +0 -0
  34. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/configuration/profiles.md +0 -0
  35. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/configuration/projects.md +0 -0
  36. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/configuration/secrets.md +0 -0
  37. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/configuration-api/profiles.md +0 -0
  38. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/glossary.md +0 -0
  39. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/templating/basics.md +0 -0
  40. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/templating/components.md +0 -0
  41. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/templating/inlining/helmcharts.md +0 -0
  42. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/templating/inlining/overview.md +0 -0
  43. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/templating/inlining/postprocessor.md +0 -0
  44. {nyl-0.5.0 → nyl-0.6.0}/docs/content/reference/templating/secrets.md +0 -0
  45. {nyl-0.5.0 → nyl-0.6.0}/docs/mkdocs.yml +0 -0
  46. {nyl-0.5.0 → nyl-0.6.0}/docs/pyproject.toml +0 -0
  47. {nyl-0.5.0 → nyl-0.6.0}/docs/uv.lock +0 -0
  48. {nyl-0.5.0 → nyl-0.6.0}/example/manifests/postgres.yaml +0 -0
  49. {nyl-0.5.0 → nyl-0.6.0}/example/nyl-profiles.yaml +0 -0
  50. {nyl-0.5.0 → nyl-0.6.0}/example/nyl-secrets.yaml +0 -0
  51. {nyl-0.5.0 → nyl-0.6.0}/example/secrets.yaml +0 -0
  52. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/README.md +0 -0
  53. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/__init__.pyi +0 -0
  54. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/dynamic/__init__.pyi +0 -0
  55. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/dynamic/client.pyi +0 -0
  56. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/dynamic/discovery.pyi +0 -0
  57. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/dynamic/exceptions.pyi +0 -0
  58. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/dynamic/resource.pyi +0 -0
  59. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/watch/__init__.pyi +0 -0
  60. {nyl-0.5.0 → nyl-0.6.0}/src/kubernetes/watch/watch.pyi +0 -0
  61. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/__init__.py +0 -0
  62. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/__init__.py +0 -0
  63. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/argocd.py +0 -0
  64. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/crds.py +0 -0
  65. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/new.py +0 -0
  66. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/profile.py +0 -0
  67. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/run.py +0 -0
  68. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/secrets.py +0 -0
  69. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/template.py +0 -0
  70. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/tools/__init__.py +0 -0
  71. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/tools/bcrypt.py +0 -0
  72. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/tools/sops.py +0 -0
  73. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/commands/tun.py +0 -0
  74. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/generator/__init__.py +0 -0
  75. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/generator/components.py +0 -0
  76. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/generator/dispatch.py +0 -0
  77. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/generator/dispatch_test.py +0 -0
  78. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/generator/helmchart.py +0 -0
  79. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/generator/statefulsecret.py +0 -0
  80. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/profiles/__init__.py +0 -0
  81. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/profiles/config.py +0 -0
  82. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/profiles/config_test.py +0 -0
  83. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/profiles/kubeconfig.py +0 -0
  84. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/profiles/tunnel.py +0 -0
  85. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/__init__.py +0 -0
  86. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/applyset.py +0 -0
  87. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/applyset_test.py +0 -0
  88. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/helmchart.py +0 -0
  89. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/placeholder.py +0 -0
  90. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/postprocessor.py +0 -0
  91. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/postprocessor_test.py +0 -0
  92. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/resources/statefulsecret.py +0 -0
  93. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/__init__.py +0 -0
  94. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/config.py +0 -0
  95. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/config_test.py +0 -0
  96. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/kubernetes.py +0 -0
  97. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/null.py +0 -0
  98. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/sops.py +0 -0
  99. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/secrets/sops_test.py +0 -0
  100. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/templating.py +0 -0
  101. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/templating_test.py +0 -0
  102. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/di.py +0 -0
  103. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/fs.py +0 -0
  104. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/fs_test.py +0 -0
  105. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/kubectl.py +0 -0
  106. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/kubernetes.py +0 -0
  107. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/kvstore.py +0 -0
  108. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/loads.py +0 -0
  109. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/logging.py +0 -0
  110. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/shell.py +0 -0
  111. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/testing.py +0 -0
  112. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/typer.py +0 -0
  113. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/types.py +0 -0
  114. {nyl-0.5.0 → nyl-0.6.0}/src/nyl/tools/yaml.py +0 -0
  115. {nyl-0.5.0 → nyl-0.6.0}/tests/__init__.py +0 -0
  116. {nyl-0.5.0 → nyl-0.6.0}/tests/conftest.py +0 -0
@@ -0,0 +1,38 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [ develop ]
6
+ tags: [ '*' ]
7
+ pull_request:
8
+ branches: [ develop ]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Check Nix flake Nixpkgs inputs
19
+ uses: DeterminateSystems/flake-checker-action@main
20
+ - uses: cachix/install-nix-action@v30
21
+ with:
22
+ nix_path: nixpkgs=channel:nixos-unstable
23
+ - uses: cachix/cachix-action@v15
24
+ with:
25
+ name: mycache
26
+ # If you chose signing key for write access
27
+ signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
28
+ # If you chose API tokens for write access OR if you have a private cache
29
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
30
+
31
+ - name: Build docs
32
+ run: nix run .#docs build
33
+
34
+ - name: Publish documentation
35
+ uses: peaceiris/actions-gh-pages@v4
36
+ with:
37
+ personal_token: ${{ secrets.GITHUB_TOKEN }}
38
+ publish_dir: ./docs/site
@@ -0,0 +1,59 @@
1
+ name: Python
2
+
3
+ on:
4
+ push:
5
+ branches: [ develop ]
6
+ tags: [ '*' ]
7
+ pull_request:
8
+ branches: [ develop ]
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Check Nix flake Nixpkgs inputs
17
+ uses: DeterminateSystems/flake-checker-action@main
18
+ - uses: cachix/install-nix-action@v30
19
+ with:
20
+ nix_path: nixpkgs=channel:nixos-unstable
21
+ - uses: cachix/cachix-action@v15
22
+ with:
23
+ name: mycache
24
+
25
+ - run: nix flake check
26
+ - run: nix run .#test
27
+
28
+ publish:
29
+ runs-on: ubuntu-latest
30
+ needs: test
31
+ environment: release
32
+ permissions:
33
+ id-token: write
34
+ if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
35
+
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: Get tags
40
+ run: git fetch --tags origin
41
+
42
+ - name: Set up Python 3.10
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.10"
46
+
47
+ - name: Bump version
48
+ run: sed 's/version = "0.0.0"/version = "${{ github.ref_name }}"/' -i pyproject.toml && git diff
49
+
50
+ - name: Install uv
51
+ run: python -m pip install uv
52
+
53
+ - name: Build dist
54
+ run: uv build
55
+
56
+ - name: Publish
57
+ uses: pypa/gh-action-pypi-publish@release/v1
58
+ with:
59
+ packages-dir: dist/
@@ -1,5 +1,6 @@
1
1
  .nyl/
2
2
  docs/site/
3
+ /result
3
4
 
4
5
  # Python
5
6
  __pycache__/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nyl
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: Advanced templating engine for Kubernetes and GitOps.
5
5
  Author-email: Niklas Rosenstein <rosensteinniklas@gmail.com>
6
6
  License: MIT
@@ -37,12 +37,22 @@ For some features, additional programs must be available:
37
37
  * [kyverno](https://kyverno.io/docs/kyverno-cli/) when using the Nyl `PostProcessor` resource
38
38
  * [sops](https://github.com/getsops/sops) when using the SOPS secrets provider
39
39
 
40
+ You can install Nyl with Nix to ensure all dependencies are met.
41
+
40
42
  ## Local development
41
43
 
42
44
  Install the project with [Uv](https://docs.astral.sh/uv/).
43
45
 
44
46
  $ uv sync
45
47
 
48
+ To lint, run
49
+
50
+ $ nix flake check
51
+
52
+ And to format code, run
53
+
54
+ $ nix fmt
55
+
46
56
  ## Tracking upstream information
47
57
 
48
58
  * Discussion around ArgoCD supporting Helm lookups (maybe with Project-level service account?), see
@@ -15,12 +15,22 @@ For some features, additional programs must be available:
15
15
  * [kyverno](https://kyverno.io/docs/kyverno-cli/) when using the Nyl `PostProcessor` resource
16
16
  * [sops](https://github.com/getsops/sops) when using the SOPS secrets provider
17
17
 
18
+ You can install Nyl with Nix to ensure all dependencies are met.
19
+
18
20
  ## Local development
19
21
 
20
22
  Install the project with [Uv](https://docs.astral.sh/uv/).
21
23
 
22
24
  $ uv sync
23
25
 
26
+ To lint, run
27
+
28
+ $ nix flake check
29
+
30
+ And to format code, run
31
+
32
+ $ nix fmt
33
+
24
34
  ## Tracking upstream information
25
35
 
26
36
  * Discussion around ArgoCD supporting Helm lookups (maybe with Project-level service account?), see
@@ -2,8 +2,8 @@
2
2
  #: Build Nyl itself.
3
3
  #: -----------------
4
4
 
5
- FROM python:3.12-alpine AS build
6
- COPY --from=ghcr.io/astral-sh/uv:0.4.7 /uv /bin/uv
5
+ FROM python:3.13-alpine AS build
6
+ COPY --from=ghcr.io/astral-sh/uv:0.5.5 /uv /bin/uv
7
7
 
8
8
  WORKDIR /opt/nyl
9
9
 
@@ -39,7 +39,8 @@ RUN \
39
39
 
40
40
  FROM fetch-bin-base AS argocd-bin
41
41
  # Find ArgoCD releases at https://github.com/argoproj/argo-cd/releases
42
- ARG ARGOCD_VERSION=v2.12.0
42
+ # renovate: datasource=github-releases depName=argocd packageName=argoproj/argo-cd
43
+ ARG ARGOCD_VERSION=v2.13.1
43
44
  RUN curl -sSfLo /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/${ARGOCD_VERSION}/argocd-linux-$(cat /BINARY_ARCH) \
44
45
  && chmod +x /usr/local/bin/argocd \
45
46
  && upx /usr/local/bin/argocd \
@@ -47,7 +48,8 @@ RUN curl -sSfLo /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releas
47
48
 
48
49
  FROM fetch-bin-base AS helm-bin
49
50
  # Find Helm releases at https://github.com/helm/helm/releases
50
- ARG HELM_VERSION=v3.15.3
51
+ # renovate: datasource=github-releases depName=helm packageName=helm/helm
52
+ ARG HELM_VERSION=v3.16.3
51
53
  RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \
52
54
  && chmod 700 get_helm.sh \
53
55
  && ./get_helm.sh --version $HELM_VERSION \
@@ -56,7 +58,8 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/s
56
58
 
57
59
  FROM fetch-bin-base AS sops-bin
58
60
  # Find SOPS releases at https://github.com/getsops/sops/releases
59
- ARG SOPS_VERSION=v3.9.0
61
+ # renovate: datasource=github-releases depName=sops packageName=getsops/sops
62
+ ARG SOPS_VERSION=v3.9.1
60
63
  RUN curl -fLO https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.$(cat /BINARY_ARCH) \
61
64
  && mv sops-${SOPS_VERSION}.linux.$(cat /BINARY_ARCH) /usr/local/bin/sops \
62
65
  && chmod +x /usr/local/bin/sops \
@@ -64,7 +67,8 @@ RUN curl -fLO https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/
64
67
  && sops --version
65
68
 
66
69
  FROM fetch-bin-base AS kyverno-bin
67
- ARG KYVERNO_VERSION=1.13.0
70
+ # renovate: datasource=github-releases depName=kyverno packageName=kyverno/kyverno
71
+ ARG KYVERNO_VERSION=1.13.1
68
72
  RUN \
69
73
  case "$(uname -m)" in \
70
74
  x86_64) KYVERNO_ARCH='x86_64' ;; \
@@ -79,7 +83,7 @@ RUN \
79
83
  #: Build the ArgoCD CMP server image.
80
84
  #: ----------------------------------
81
85
 
82
- FROM python:3.12-alpine AS nyl-cmp
86
+ FROM python:3.13-alpine AS nyl-cmp
83
87
  RUN apk add git
84
88
  COPY --from=argocd-bin /usr/local/bin/argocd /usr/local/bin/argocd
85
89
  RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && chown 999:999 /usr/local/bin/argocd-cmp-server
@@ -4,3 +4,8 @@
4
4
  options:
5
5
  show_root_heading: true
6
6
  show_source: false
7
+
8
+ ::: nyl.secrets.kubernetes
9
+ options:
10
+ show_root_heading: true
11
+ show_source: false
nyl-0.6.0/flake.lock ADDED
@@ -0,0 +1,348 @@
1
+ {
2
+ "nodes": {
3
+ "flake-utils": {
4
+ "inputs": {
5
+ "systems": "systems"
6
+ },
7
+ "locked": {
8
+ "lastModified": 1726560853,
9
+ "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
10
+ "owner": "numtide",
11
+ "repo": "flake-utils",
12
+ "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
13
+ "type": "github"
14
+ },
15
+ "original": {
16
+ "owner": "numtide",
17
+ "repo": "flake-utils",
18
+ "type": "github"
19
+ }
20
+ },
21
+ "lix": {
22
+ "flake": false,
23
+ "locked": {
24
+ "lastModified": 1730846669,
25
+ "narHash": "sha256-HUdKD2GLudNnQm4yvakMSUhcHF2g0Nc+1QxgDwrlU90=",
26
+ "ref": "refs/heads/main",
27
+ "rev": "72292671a9e1c7600d1cc4240e717ac3bdd6cef0",
28
+ "revCount": 16450,
29
+ "type": "git",
30
+ "url": "https://git.lix.systems/lix-project/lix.git"
31
+ },
32
+ "original": {
33
+ "type": "git",
34
+ "url": "https://git.lix.systems/lix-project/lix.git"
35
+ }
36
+ },
37
+ "lix-unit": {
38
+ "inputs": {
39
+ "lix": "lix",
40
+ "mdbook-nixdoc": [
41
+ "pyproject-nix",
42
+ "mdbook-nixdoc"
43
+ ],
44
+ "nix-github-actions": [
45
+ "pyproject-nix",
46
+ "nix-github-actions"
47
+ ],
48
+ "nixpkgs": [
49
+ "pyproject-nix",
50
+ "nixpkgs"
51
+ ],
52
+ "treefmt-nix": [
53
+ "pyproject-nix",
54
+ "treefmt-nix"
55
+ ]
56
+ },
57
+ "locked": {
58
+ "lastModified": 1730863251,
59
+ "narHash": "sha256-NoImlilaWPAGWz/Ja0uXcagQ8UK61KEev2jFDM+vgzQ=",
60
+ "owner": "adisbladis",
61
+ "repo": "lix-unit",
62
+ "rev": "2893fe1a7e870a3da8a04be89ca494c1ff9c3e82",
63
+ "type": "github"
64
+ },
65
+ "original": {
66
+ "owner": "adisbladis",
67
+ "repo": "lix-unit",
68
+ "type": "github"
69
+ }
70
+ },
71
+ "lix-unit_2": {
72
+ "inputs": {
73
+ "lix": "lix_2",
74
+ "mdbook-nixdoc": [
75
+ "uv2nix",
76
+ "mdbook-nixdoc"
77
+ ],
78
+ "nix-github-actions": [
79
+ "uv2nix",
80
+ "nix-github-actions"
81
+ ],
82
+ "nixpkgs": [
83
+ "uv2nix",
84
+ "nixpkgs"
85
+ ],
86
+ "treefmt-nix": [
87
+ "uv2nix",
88
+ "treefmt-nix"
89
+ ]
90
+ },
91
+ "locked": {
92
+ "lastModified": 1730863251,
93
+ "narHash": "sha256-NoImlilaWPAGWz/Ja0uXcagQ8UK61KEev2jFDM+vgzQ=",
94
+ "owner": "adisbladis",
95
+ "repo": "lix-unit",
96
+ "rev": "2893fe1a7e870a3da8a04be89ca494c1ff9c3e82",
97
+ "type": "github"
98
+ },
99
+ "original": {
100
+ "owner": "adisbladis",
101
+ "repo": "lix-unit",
102
+ "type": "github"
103
+ }
104
+ },
105
+ "lix_2": {
106
+ "flake": false,
107
+ "locked": {
108
+ "lastModified": 1730846669,
109
+ "narHash": "sha256-HUdKD2GLudNnQm4yvakMSUhcHF2g0Nc+1QxgDwrlU90=",
110
+ "ref": "refs/heads/main",
111
+ "rev": "72292671a9e1c7600d1cc4240e717ac3bdd6cef0",
112
+ "revCount": 16450,
113
+ "type": "git",
114
+ "url": "https://git.lix.systems/lix-project/lix.git"
115
+ },
116
+ "original": {
117
+ "type": "git",
118
+ "url": "https://git.lix.systems/lix-project/lix.git"
119
+ }
120
+ },
121
+ "mdbook-nixdoc": {
122
+ "inputs": {
123
+ "nix-github-actions": [
124
+ "pyproject-nix",
125
+ "nix-github-actions"
126
+ ],
127
+ "nixpkgs": [
128
+ "pyproject-nix",
129
+ "nixpkgs"
130
+ ]
131
+ },
132
+ "locked": {
133
+ "lastModified": 1708395692,
134
+ "narHash": "sha256-smf0VmxGbjJDZqKvxxG3ZVqubgbVwAWG26wPo+BT/A0=",
135
+ "owner": "adisbladis",
136
+ "repo": "mdbook-nixdoc",
137
+ "rev": "d6a71b114b9221c0b4f20d31b81766d072cc26be",
138
+ "type": "github"
139
+ },
140
+ "original": {
141
+ "owner": "adisbladis",
142
+ "repo": "mdbook-nixdoc",
143
+ "type": "github"
144
+ }
145
+ },
146
+ "mdbook-nixdoc_2": {
147
+ "inputs": {
148
+ "nix-github-actions": [
149
+ "uv2nix",
150
+ "nix-github-actions"
151
+ ],
152
+ "nixpkgs": [
153
+ "uv2nix",
154
+ "nixpkgs"
155
+ ]
156
+ },
157
+ "locked": {
158
+ "lastModified": 1708395692,
159
+ "narHash": "sha256-smf0VmxGbjJDZqKvxxG3ZVqubgbVwAWG26wPo+BT/A0=",
160
+ "owner": "adisbladis",
161
+ "repo": "mdbook-nixdoc",
162
+ "rev": "d6a71b114b9221c0b4f20d31b81766d072cc26be",
163
+ "type": "github"
164
+ },
165
+ "original": {
166
+ "owner": "adisbladis",
167
+ "repo": "mdbook-nixdoc",
168
+ "type": "github"
169
+ }
170
+ },
171
+ "nix-github-actions": {
172
+ "inputs": {
173
+ "nixpkgs": [
174
+ "pyproject-nix",
175
+ "nixpkgs"
176
+ ]
177
+ },
178
+ "locked": {
179
+ "lastModified": 1729742964,
180
+ "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=",
181
+ "owner": "nix-community",
182
+ "repo": "nix-github-actions",
183
+ "rev": "e04df33f62cdcf93d73e9a04142464753a16db67",
184
+ "type": "github"
185
+ },
186
+ "original": {
187
+ "owner": "nix-community",
188
+ "repo": "nix-github-actions",
189
+ "type": "github"
190
+ }
191
+ },
192
+ "nix-github-actions_2": {
193
+ "inputs": {
194
+ "nixpkgs": [
195
+ "uv2nix",
196
+ "nixpkgs"
197
+ ]
198
+ },
199
+ "locked": {
200
+ "lastModified": 1729742964,
201
+ "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=",
202
+ "owner": "nix-community",
203
+ "repo": "nix-github-actions",
204
+ "rev": "e04df33f62cdcf93d73e9a04142464753a16db67",
205
+ "type": "github"
206
+ },
207
+ "original": {
208
+ "owner": "nix-community",
209
+ "repo": "nix-github-actions",
210
+ "type": "github"
211
+ }
212
+ },
213
+ "nixpkgs": {
214
+ "locked": {
215
+ "lastModified": 1730785428,
216
+ "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
217
+ "owner": "nixos",
218
+ "repo": "nixpkgs",
219
+ "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
220
+ "type": "github"
221
+ },
222
+ "original": {
223
+ "owner": "nixos",
224
+ "ref": "nixos-unstable",
225
+ "repo": "nixpkgs",
226
+ "type": "github"
227
+ }
228
+ },
229
+ "pyproject-nix": {
230
+ "inputs": {
231
+ "lix-unit": "lix-unit",
232
+ "mdbook-nixdoc": "mdbook-nixdoc",
233
+ "nix-github-actions": "nix-github-actions",
234
+ "nixpkgs": [
235
+ "nixpkgs"
236
+ ],
237
+ "treefmt-nix": "treefmt-nix"
238
+ },
239
+ "locked": {
240
+ "lastModified": 1730863432,
241
+ "narHash": "sha256-xn3xCNJRrveAnAodqjZj0ZQ5kbrcnpcM3zUGlygoKbc=",
242
+ "owner": "nix-community",
243
+ "repo": "pyproject.nix",
244
+ "rev": "d78783b228419b475002e396c2433ecc82bbc7b0",
245
+ "type": "github"
246
+ },
247
+ "original": {
248
+ "owner": "nix-community",
249
+ "repo": "pyproject.nix",
250
+ "type": "github"
251
+ }
252
+ },
253
+ "root": {
254
+ "inputs": {
255
+ "flake-utils": "flake-utils",
256
+ "nixpkgs": "nixpkgs",
257
+ "pyproject-nix": "pyproject-nix",
258
+ "uv2nix": "uv2nix"
259
+ }
260
+ },
261
+ "systems": {
262
+ "locked": {
263
+ "lastModified": 1681028828,
264
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
265
+ "owner": "nix-systems",
266
+ "repo": "default",
267
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
268
+ "type": "github"
269
+ },
270
+ "original": {
271
+ "owner": "nix-systems",
272
+ "repo": "default",
273
+ "type": "github"
274
+ }
275
+ },
276
+ "treefmt-nix": {
277
+ "inputs": {
278
+ "nixpkgs": [
279
+ "pyproject-nix",
280
+ "nixpkgs"
281
+ ]
282
+ },
283
+ "locked": {
284
+ "lastModified": 1730321837,
285
+ "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=",
286
+ "owner": "numtide",
287
+ "repo": "treefmt-nix",
288
+ "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc",
289
+ "type": "github"
290
+ },
291
+ "original": {
292
+ "owner": "numtide",
293
+ "repo": "treefmt-nix",
294
+ "type": "github"
295
+ }
296
+ },
297
+ "treefmt-nix_2": {
298
+ "inputs": {
299
+ "nixpkgs": [
300
+ "uv2nix",
301
+ "nixpkgs"
302
+ ]
303
+ },
304
+ "locked": {
305
+ "lastModified": 1730321837,
306
+ "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=",
307
+ "owner": "numtide",
308
+ "repo": "treefmt-nix",
309
+ "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc",
310
+ "type": "github"
311
+ },
312
+ "original": {
313
+ "owner": "numtide",
314
+ "repo": "treefmt-nix",
315
+ "type": "github"
316
+ }
317
+ },
318
+ "uv2nix": {
319
+ "inputs": {
320
+ "lix-unit": "lix-unit_2",
321
+ "mdbook-nixdoc": "mdbook-nixdoc_2",
322
+ "nix-github-actions": "nix-github-actions_2",
323
+ "nixpkgs": [
324
+ "nixpkgs"
325
+ ],
326
+ "pyproject-nix": [
327
+ "pyproject-nix"
328
+ ],
329
+ "treefmt-nix": "treefmt-nix_2"
330
+ },
331
+ "locked": {
332
+ "lastModified": 1730876081,
333
+ "narHash": "sha256-lynNnnKxF4zNlmmMtCIrmbWM7V1GPEMWrFc8MXbmVJI=",
334
+ "owner": "adisbladis",
335
+ "repo": "uv2nix",
336
+ "rev": "7184376b4e8fbf80dcce44f9b48cd909176dd0f4",
337
+ "type": "github"
338
+ },
339
+ "original": {
340
+ "owner": "adisbladis",
341
+ "repo": "uv2nix",
342
+ "type": "github"
343
+ }
344
+ }
345
+ },
346
+ "root": "root",
347
+ "version": 7
348
+ }
nyl-0.6.0/flake.nix ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ description = "Nyl is a high-level Kubernetes project management tool.";
3
+
4
+ inputs = {
5
+ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
6
+ flake-utils.url = "github:numtide/flake-utils";
7
+
8
+ pyproject-nix = {
9
+ url = "github:nix-community/pyproject.nix";
10
+ inputs.nixpkgs.follows = "nixpkgs";
11
+ };
12
+
13
+ uv2nix = {
14
+ url = "github:adisbladis/uv2nix";
15
+ inputs.pyproject-nix.follows = "pyproject-nix";
16
+ inputs.nixpkgs.follows = "nixpkgs";
17
+ };
18
+ };
19
+
20
+ # TODO: Build argocd-cmp Docker image with Nix.
21
+
22
+ outputs = { self, nixpkgs, flake-utils, pyproject-nix, uv2nix }:
23
+ flake-utils.lib.eachDefaultSystem (system:
24
+ let
25
+ pkgs = nixpkgs.legacyPackages.${system};
26
+ uv = pkgs.callPackage ./nix/uv.nix { inherit uv2nix pyproject-nix; };
27
+
28
+ uvProject = uv.loadProject {
29
+ workspaceRoot = ./.;
30
+ python = pkgs.python312;
31
+ # TODO: Pass runtimeInputs here?
32
+ };
33
+
34
+ mypyConfig = pkgs.writeText "mypy.ini" ''
35
+ [mypy]
36
+ explicit_package_bases = true
37
+ namespace_packages = true
38
+ show_column_numbers = true
39
+ strict = true
40
+ mypy_path = src
41
+ '';
42
+
43
+ ruffConfig = pkgs.writeText "ruff.toml" ''
44
+ line-length = 120
45
+ '';
46
+
47
+ dependencies =
48
+ [ pkgs.kubernetes-helm pkgs.kyverno pkgs.sops pkgs.kubectl ];
49
+ in rec {
50
+ packages.default =
51
+ uvProject.script "nyl" { runtimeInputs = dependencies; };
52
+
53
+ packages.docs = let
54
+ docs = uv.loadProject {
55
+ workspaceRoot = ./docs;
56
+ python = pkgs.python312;
57
+ };
58
+ mkdocs = docs.command "mkdocs";
59
+ in pkgs.writeShellScriptBin "docs" ''
60
+ set -eu
61
+ cd docs
62
+ ${mkdocs} $@
63
+ '';
64
+
65
+ # TODO: Use formatter.fmt, but it complains about missing type attribute
66
+ # TODO: Have it also fmt the nix code
67
+ formatter = pkgs.writeShellScriptBin "fmt" ''
68
+ set -x
69
+ ${uvProject.devCommand "ruff"} --config ${ruffConfig} format .
70
+ ${pkgs.nixfmt-classic}/bin/nixfmt .
71
+ '';
72
+
73
+ # TODO: Do not require ruff/mypy to be dependencies of the project?
74
+
75
+ packages.lint = pkgs.writeShellScriptBin "lint" ''
76
+ set -x
77
+ checkDir="''${1:-src}"
78
+ ${uvProject.devCommand "ruff"} --config ${ruffConfig} check "${
79
+ ./.
80
+ }/$checkDir"
81
+ ${
82
+ uvProject.devCommand "ruff"
83
+ } --config ${ruffConfig} format --check "${./.}/$checkDir"
84
+ # TODO: If we don't copy the workdir to the nix store we get more Mypy errors :(
85
+ ${uvProject.devCommand "dmypy"} run -- --config-file ${mypyConfig} "${
86
+ ./.
87
+ }/$checkDir"
88
+ ${pkgs.nixfmt-classic}/bin/nixfmt --check .
89
+ '';
90
+
91
+ packages.test = let
92
+ dependenciesPath = nixpkgs.lib.concatStringsSep ":"
93
+ (map (dep: "${dep}/bin") dependencies);
94
+ in pkgs.writeShellScriptBin "test"
95
+ "PATH=\${PATH}:${dependenciesPath} ${uvProject.devCommand "pytest"} ${
96
+ ./.
97
+ }";
98
+
99
+ checks.lint = pkgs.runCommand "lint" { } ''
100
+ # TODO: Is it an issue that this runs the Mypy daemon?
101
+ ${packages.lint}/bin/lint
102
+ echo Done > $out
103
+ '';
104
+
105
+ checks.test = pkgs.runCommand "test" { } ''
106
+ ${packages.test}/bin/test
107
+ echo Done > $out
108
+ '';
109
+
110
+ devShells.default =
111
+ pkgs.mkShell { buildInputs = [ uvProject.venv.dev ]; };
112
+ });
113
+ }