-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
77 lines (62 loc) · 2.26 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
68
69
70
71
72
73
74
75
76
77
{
description = "Astronomical observing management backend";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-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, lib, ... }: {
# 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 = {
languages.python = {
enable = true;
package = pkgs.python310;
poetry = {
enable = true;
activate.enable = true;
install.enable = true;
};
};
# https://devenv.sh/packages/
packages = [
pkgs.gfortran.cc.lib
];
# https://devenv.sh/reference/options/#entershell
enterShell = ''
export KUBECONFIG="`pwd`/local-kubeconfig"
echo "Setting KUBECONFIG=$KUBECONFIG"
echo
echo "This is done to sandbox Kuberenetes tools (kubectl, skaffold, etc) to the local K8s cluster for this project."
touch "$DEVENV_ROOT/k8s/envs/local/secrets.env"
'';
};
};
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.
};
};
}