-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
85 lines (75 loc) · 2.33 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
80
81
82
83
84
85
{
description = "TiMMi Server setup";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-deploy-git = {
url = "github:johannesloetzsch/nix-deploy-git/main";
inputs.nixpkgs.follows = "nixpkgs";
};
dns = {
url = "github:kirelagin/dns.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, sops-nix, nix-deploy-git, dns }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
commonAttrs = {
system = "x86_64-linux";
extraArgs = { flake = self; inherit system dns; };
};
commonModules = [
./modules/nix.nix
sops-nix.nixosModules.sops
./modules/sops.nix
./modules/default.nix
./modules/dns.nix
./modules/monitoring/client.nix
./modules/nginx/timmi.nix
nix-deploy-git.nixosModule
./modules/nix-deploy-git.nix
];
in
rec {
legacyPackages.${system} = (lib.mergeAttrs pkgs {
timmi-nixos-deploy = import ./tools/deploy.nix { inherit pkgs; };
});
defaultPackage.${system} = legacyPackages.${system}.timmi-nixos-deploy;
nixosModules = {
default = import ./modules/default.nix;
binarycache-client = import ./modules/binarycache/client.nix;
};
nixosConfigurations = {
test = nixpkgs.lib.nixosSystem (lib.mergeAttrs commonAttrs {
modules = commonModules ++ [
./hosts/test/configuration.nix
./modules/binarycache/server.nix
./modules/monitoring/server.nix
./modules/jenkins.nix
#./modules/de4l/kibana.nix ## not required at the moment -> save memory
#./modules/de4l/mqtt.nix ## deprecated
];
});
staging = nixpkgs.lib.nixosSystem (lib.mergeAttrs commonAttrs {
modules = commonModules ++ [
./hosts/staging/configuration.nix
./modules/binarycache/client.nix
./modules/backup.nix
];
});
productive = nixpkgs.lib.nixosSystem (lib.mergeAttrs commonAttrs {
modules = commonModules ++ [
./hosts/productive/configuration.nix
./modules/binarycache/client.nix
./modules/nginx/timmi-public.nix
];
});
};
};
}