-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
31 lines (31 loc) · 996 Bytes
/
shell.nix
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
{
pkgs ? (
import <nixpkgs> {
config.allowUnfree = true;
}
),
...
}:
pkgs.mkShell {
buildInputs = [
pkgs.kustomize
];
packages = [
(pkgs.writeShellScriptBin "buildCnpg" ''
#!/bin/bash
set -e
rm -rf gitops/apps/cnpg/upstream
mkdir -p gitops/apps/cnpg/upstream
strippedVersion=$(echo "$1" | sed 's/^v//')
cnpghash=$(nix-prefetch-url https://github.com/cloudnative-pg/cloudnative-pg/releases/download/$1/cnpg-$strippedVersion.yaml)
cp -r --no-preserve=mode $(nix-build nix/cnpg.nix --argstr manifest01Hash "$cnpghash" --argstr version $1)/* gitops/apps/cnpg/upstream/
'')
(pkgs.writeShellScriptBin "buildIngressContour" ''
#!/bin/bash
set -e
rm -rf gitops/apps/ingress-controller-external/upstream
mkdir -p gitops/apps/ingress-controller-external/upstream
cp -r --no-preserve=mode $(nix-build nix/ingress-contour.nix)/* gitops/apps/ingress-controller-external/upstream/
'')
];
}