-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
79 lines (69 loc) · 2.07 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
78
79
{
description = "Hyperconverged Infratructure for NixOS";
inputs = {
microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs";
nix-cache-cut.url = "github:astro/nix-cache-cut";
};
outputs = { self, nixpkgs, microvm, nix-cache-cut }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system} = import ./pkgs/doc.nix {
inherit pkgs self;
};
nixosModules = {
default = {
imports = [
./nixos-modules/storage/ceph/server.nix
./nixos-modules/defaults.nix
./nixos-modules/nodes.nix
./nixos-modules/nomad.nix
./nixos-modules/users.nix
(import ./nixos-modules/ssh-deploy.nix {
inherit microvm nixpkgs;
})
{
nixpkgs.overlays = [
nix-cache-cut.overlays.default
];
}
./nixos-modules/cache-cut.nix
];
};
};
nixosConfigurations =
let
makeExampleSystem = instance:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
microvm.nixosModules.microvm
self.nixosModules.default
(import ./example-server.nix { inherit instance; })
];
};
in {
example1 = makeExampleSystem 1;
example2 = makeExampleSystem 2;
example3 = makeExampleSystem 3;
};
apps.${system} =
let
makeExample = instance: {
type = "app";
program = "${self.nixosConfigurations."example${toString instance}".config.microvm.declaredRunner}/bin/microvm-run";
};
in {
default = makeExample 1;
example1 = makeExample 1;
example2 = makeExample 2;
example3 = makeExample 3;
make-ceph = {
type = "app";
program = toString (pkgs.callPackage ./pkgs/make-ceph.nix {});
};
};
};
}