mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
Add flake
Chopped-down version of heywoodlh's.
This commit is contained in:
parent
a81e2fa3e4
commit
154cea3c09
1 changed files with 76 additions and 0 deletions
76
flake.nix
Normal file
76
flake.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
description = "heywoodlh kubernetes flake";
|
||||
|
||||
inputs = {
|
||||
# Base
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
|
||||
nixhelm.url = "github:farcaller/nixhelm";
|
||||
|
||||
# Charts from Git
|
||||
nfs-helm = {
|
||||
url = "github:kubernetes-sigs/nfs-subdir-external-provisioner";
|
||||
flake = false; # DRY this
|
||||
};
|
||||
longhorn = {
|
||||
url = "github:longhorn/longhorn/19e8fefd3ace7fb66c3f3521fc471b60a829b155"; # v1.5.1
|
||||
flake = false;
|
||||
};
|
||||
app-template = {
|
||||
# These branch comments suck but they're necessary until NixOS/nix#8226.
|
||||
url = "github:bjw-s/helm-charts/8bfc33eb8a3dbb989e56e3b61d65a28c3def358e"; # v2.2.0
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
nix-kube-generators,
|
||||
nixhelm,
|
||||
nfs-helm,
|
||||
longhorn,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
kubelib = nix-kube-generators.lib { inherit pkgs; };
|
||||
in {
|
||||
packages = {
|
||||
longhorn = pkgs.stdenv.mkDerivation {
|
||||
name = "longhorn";
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
cp ${longhorn}/deploy/longhorn.yaml $out
|
||||
'';
|
||||
};
|
||||
|
||||
nfs-kube = (kubelib.buildHelmChart {
|
||||
name = "nfs-subdir";
|
||||
chart = "${nfs-helm}/charts/nfs-subdir-external-provisioner";
|
||||
namespace = "kube-system";
|
||||
values = {
|
||||
fullnameOverride = "nfs-subdir";
|
||||
image.tag = "v4.0.2";
|
||||
nfs = {
|
||||
path = "/nfs/svc";
|
||||
server = "losangeles.eureka.lan";
|
||||
};
|
||||
storageClass.name = "nfs-subdir";
|
||||
};
|
||||
});
|
||||
};
|
||||
devShell = pkgs.mkShell {
|
||||
name = "kubernetes-shell";
|
||||
buildInputs = with pkgs; [
|
||||
k9s
|
||||
kubectl
|
||||
kubernetes-helm
|
||||
];
|
||||
};
|
||||
formatter = pkgs.alejandra;
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue