-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
44 lines (41 loc) · 1.23 KB
/
default.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
{ system ? builtins.currentSystem
, env_prefix
}:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
modulesPath = "${pkgs.path}/nixos/modules";
srvos = (import sources.srvos).modules;
base = pkgs.nixos {
imports = [
"${toString modulesPath}/virtualisation/amazon-image.nix"
"${pkgs.path}/nixos/maintainers/scripts/ec2/amazon-image.nix"
({...}: { amazonImage.sizeMB = 16 * 1024; })
];
};
web = pkgs.nixos {
imports = [
{ inherit env_prefix; }
hosts/web.nix
"${toString modulesPath}/virtualisation/amazon-image.nix"
"${pkgs.path}/nixos/maintainers/scripts/ec2/amazon-image.nix"
({...}: { amazonImage.sizeMB = 16 * 1024; })
];
};
gh-runner = pkgs.nixos {
imports = [
{ inherit env_prefix; }
hosts/gh-runner.nix
"${toString modulesPath}/virtualisation/amazon-image.nix"
"${pkgs.path}/nixos/maintainers/scripts/ec2/amazon-image.nix"
srvos.nixos.roles-github-actions-runner
({...}: { amazonImage.sizeMB = 16 * 1024; })
];
};
in
{
# Build with nix-build -A <attr>
image = base.config.system.build.amazonImage;
web = web.config.system.build.toplevel;
gh-runner = gh-runner.config.system.build.toplevel;
}