-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
67 lines (62 loc) · 2.14 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
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.8)
{
# A helpful description of your flake
description = "Astraios";
# Flake inputs
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
};
# Flake outputs that other flakes can use
outputs = { self, flake-schemas, nixpkgs }:
let
# Helpers for producing system-specific outputs
supportedSystems = [ "x86_64-linux" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in {
# Schemas tell Nix about the structure of your flake's outputs
schemas = flake-schemas.schemas;
# Development environments
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
# Pinned packages available in the environment
packages = with pkgs; [
nodePackages.pnpm
nixpkgs-fmt
];
};
});
# Production-ready packages
packages = forEachSupportedSystem ({ pkgs }: rec {
frontend = pkgs.stdenv.mkDerivation {
name = "@astraios/frontend";
src = "${self}/frontend";
buildInputs = with pkgs; [ nodePackages.pnpm ];
buildPhase = ''
export HOME=$TEMPDIR
pnpm config set strict-ssl false
pnpm install
pnpm run build
'';
installPhase = ''
mkdir -p $out
cp -r dist/* $out/
'';
};
default = frontend;
envoyImage = pkgs.dockerTools.buildImage {
name = "@astraios/envoyproxy";
tag = "latest";
contents = [ frontend.packages.x86_64-linux.default ];
config = {
Cmd = [ "-c /etc/envoy/envoy.yaml" "-l trace" "--log-path /tmp/envoy_info.log" ];
Entrypoint = [ "/usr/local/bin/envoy" ];
# ExposedPorts = { "80/tcp" = {}; };
# Volumes = { "/etc/envoy" = {}; };
};
};
});
};
}