-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
87 lines (75 loc) · 2.21 KB
/
Copy pathflake.nix
File metadata and controls
87 lines (75 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
description = "zero-cache Helm chart version manager";
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
flake-parts.url = "https://flakehub.com/f/hercules-ci/flake-parts/0.1";
};
outputs = inputs @ {
flake-parts,
nixpkgs,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
flake.chartMetadata = import ./chart.nix;
flake.chart = let
helmFiles = builtins.path {
path = ./.;
name = "zero-cache-chart-src";
filter = path: type: let
base = builtins.baseNameOf path;
relPath = builtins.substring (builtins.stringLength (toString ./.) + 1) (-1) (toString path);
in
builtins.elem base ["Chart.yaml" "values.yaml" "Chart.lock" ".helmignore"]
|| nixpkgs.lib.hasPrefix "templates" relPath;
};
in
helmFiles;
perSystem = {pkgs, ...}: let
python = pkgs.python3;
zero-cache-chart = python.pkgs.buildPythonApplication {
pname = "zero-cache-chart";
version = "0.0.0";
pyproject = true;
src = ./.;
build-system = [python.pkgs.hatchling];
dependencies = with python.pkgs; [
click
pyyaml
requests
semver
];
nativeCheckInputs =
[pkgs.git]
++ (with python.pkgs; [
pytestCheckHook
pytest-mock
responses
]);
makeWrapperArgs = [
"--prefix PATH : ${pkgs.lib.makeBinPath [pkgs.kubernetes-helm pkgs.oras]}"
];
};
in {
packages.default = zero-cache-chart;
devShells.default = pkgs.mkShell {
packages = [
(python.withPackages (ps:
with ps; [
click
pyyaml
requests
semver
pytest
pytest-mock
responses
]))
pkgs.kubernetes-helm
pkgs.kubeconform
pkgs.helm-docs
pkgs.oras
];
};
};
};
}