This repository has been archived by the owner on Dec 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
92 lines (82 loc) · 2.44 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
86
87
88
89
90
91
92
{
description = "OpenZiti patched binaries";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-22.11-darwin";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-parts.url = "github:hercules-ci/flake-parts";
napalm = {
url = "github:nix-community/napalm";
inputs.nixpkgs.follows = "nixpkgs";
};
zitiConsole = {
url = "github:openziti/ziti-console";
flake = false;
};
};
outputs = {
self,
nixpkgs,
nixpkgs-darwin,
flake-compat,
flake-parts,
napalm,
zitiConsole,
}:
flake-parts.lib.mkFlake {inherit self;} {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = {
inputs',
pkgs,
system,
...
}: let
inherit (pkgs.lib) pipe recursiveUpdate;
inherit (zitiVersions) state;
zitiLib = (import lib/lib.nix) pkgs;
zitiVersions = (import ./versions.nix) pkgs;
in
with pkgs; rec {
devShells.default = mkShell {
buildInputs = with packages; [
alejandra
shfmt
treefmt
ziti-cli-functions_latest
ziti-controller_latest
ziti-edge-tunnel_latest
ziti_latest
ziti-router_latest
ziti-tunnel_latest
];
};
legacyPackages = packages;
packages = with zitiLib;
pipe {} [
(recursiveUpdate (mkZitiPkgs state))
(recursiveUpdate (mkZitiBinTypePkgs state "controller"))
(recursiveUpdate (mkZitiBinTypePkgs state "router"))
(recursiveUpdate (mkZitiBinTypePkgs state "tunnel"))
(recursiveUpdate (mkZitiCliFnPkgs state))
(recursiveUpdate (mkZitiConsole inputs' self))
(recursiveUpdate (mkZitiEdgeTunnelPkgs state system))
(recursiveUpdate {default = packages.ziti-edge-tunnel_latest;})
];
};
flake = {
nixosModules = {
ziti-controller = import ./modules/ziti-controller.nix self;
ziti-console = import ./modules/ziti-console.nix self;
ziti-edge-tunnel = import ./modules/ziti-edge-tunnel.nix self;
ziti-router = import ./modules/ziti-router.nix self;
};
};
};
}