-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
67 lines (53 loc) · 2.13 KB
/
flake.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
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
{
description = "Description for the project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv-k8s.url = "github:LCOGT/devenv-k8s";
nixpkgs.follows = "devenv-k8s/nixpkgs";
flake-parts.follows = "devenv-k8s/flake-parts";
};
nixConfig = {
extra-substituters = [
"https://devenv.cachix.org"
"https://lco-public.cachix.org"
];
extra-trusted-public-keys = [
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"lco-public.cachix.org-1:zSmLK7CkAehZ7QzTLZKt+5Y26Lr0w885GUB4GlT1SCg="
];
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devenv-k8s.flakeModules.default
];
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
# https://devenv.sh/basics/
# Enter using `nix develop --impure`
config.devenv.shells.default = {
# https://devenv.sh/packages/
packages = [
];
# https://devenv.sh/reference/options/#entershell
enterShell = ''
export KUBECONFIG="`pwd`/local-kubeconfig"
echo "Setting KUBECONFIG=$KUBECONFIG"
echo
echo "This is done to sandbox Kubernetes tools (kubectl, skaffold, etc) to the local K8s cluster for this project."
echo "If you would like to use a local K8s cluster across multiple projects, then set 'KUBECONFIG' to a common path"
echo "in both projects before running the command to create the local cluster."
'';
};
};
flake = {
# The usual flake attributes can be defined here, including system-
# agnostic ones like nixosModule and system-enumerating ones, although
# those are more easily expressed in perSystem.
};
};
}