-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathflake.nix
More file actions
161 lines (145 loc) · 4.29 KB
/
Copy pathflake.nix
File metadata and controls
161 lines (145 loc) · 4.29 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
description = "Flake containing Bitte clusters";
# --- Public Inputs --------
# intended to defer locking to the consumer
inputs = {
nixpkgs.url = "nixos-21_11";
nixpkgs-unstable.url = "nixpkgs-unstable";
nix.url = "nix-2_10";
ops-lib = {
url = "ops-lib";
flake = false;
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
nix,
...
} @ pub: let
inherit (inputs) std utils;
priv = (import ./lib/call-flake.nix) {
type = "path";
path = ./private;
# needs to be updated any time private inputs are touched
narHash = "sha256-WpyvDOGanWmgh1bk/KF8L0SL/wkJq9oB6aswlIDtNRs=";
} {};
inputs = priv.inputs // pub;
in
inputs.std.growOn {
inherit inputs;
cellsFrom = ./nix;
organelles = [
(inputs.std.devshells "devshells")
(inputs.std.installables "packages")
# ----------
# NixOS: Modules, Profiles, Aggregates
# ----------
# profile aggregates - combine profiles into classes
# "composition over case switches"
(inputs.std.functions "aggregates")
# profiles - have side effects; don't define options
(inputs.std.functions "profiles")
# modules - have no side effects; define options
(inputs.std.functions "modules")
# ----------
# Terraform: loops
# ----------
# loops - reconcile a target state
(inputs.std.functions "loops")
];
}
# soil -- TODO: remove soil
(let
overlays = [
inputs.hydra.overlay
# inputs.deploy.overlay
localPkgsOverlay
terraformProvidersOverlay
(_: prev: {inherit (self.packages."${prev.system}") bitte;})
];
terraformProvidersOverlay =
import ./terraform-providers-overlay.nix inputs;
localPkgsOverlay = import ./overlay.nix inputs;
pkgsForSystem = system:
import nixpkgs {
inherit overlays system;
config.allowUnfree = true; # for ssm-session-manager-plugin
};
unstablePkgsForSystem = system:
import nixpkgs-unstable {
inherit overlays system;
};
lib = import ./lib {
inherit (nixpkgs) lib;
inherit inputs;
};
in
utils.lib.eachSystem [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
] (system: let
legacyPackages = pkgsForSystem system;
unstablePackages = unstablePkgsForSystem system;
in rec {
inherit legacyPackages;
packages = {inherit (self.${system}.cli.packages) bitte;};
defaultPackage = packages.bitte;
hydraJobs = let
constituents = {
inherit
(legacyPackages)
bitte
cfssl
ci-env
consul
cue
glusterfs
grafana-loki
haproxy
haproxy-auth-request
haproxy-cors
nixFlakes
nomad
nomad-autoscaler
oauth2-proxy
sops
terraform-with-plugins
vault-backend
vault-bin
;
};
in {
inherit constituents;
required = legacyPackages.mkRequired constituents;
};
})
// {
inherit lib;
# eta reduce not possibe since flake check validates for "final" / "prev"
overlay = nixpkgs.lib.composeManyExtensions overlays;
profiles = lib.mkModules ./profiles;
nixosModules =
(lib.mkModules ./modules)
// {
# Until ready to update to the new age module options
# agenix = ragenix.nixosModules.age;
};
nixosModule.imports = builtins.attrValues self.nixosModules;
devshellModule = import ./devshellModule.nix;
});
nixConfig = {
flake-registry = "https://raw.githubusercontent.com/input-output-hk/flake-registry/iog/flake-registry.json";
extra-substituters = [
"https://nix-community.cachix.org"
"https://cache.iog.io"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}