2022-02-01 01:30:23 +00:00
|
|
|
{
|
|
|
|
description = "devs & ops environment for nix'ing with triton";
|
|
|
|
|
|
|
|
inputs.devshell.url = "github:numtide/devshell";
|
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
2022-02-22 14:09:03 +00:00
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2022-02-01 01:30:23 +00:00
|
|
|
|
2022-06-09 12:25:46 +00:00
|
|
|
outputs = { self, flake-utils, devshell, nixpkgs }:
|
2022-06-09 12:43:04 +00:00
|
|
|
flake-utils.lib.eachSystem [
|
|
|
|
"aarch64-linux"
|
|
|
|
"i686-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"x86_64-linux"
|
|
|
|
]
|
2022-10-11 08:44:32 +00:00
|
|
|
(
|
|
|
|
system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
|
|
|
|
overlays = [
|
|
|
|
devshell.overlay
|
|
|
|
(import ./overlay.nix)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2022-10-07 12:44:26 +00:00
|
|
|
devshellModules.tritonshell = { config, lib, ... }: {
|
|
|
|
options.environment = {
|
2022-10-11 08:44:32 +00:00
|
|
|
enable = lib.mkEnableOption "triton DevOps shell environment";
|
2022-06-09 12:43:04 +00:00
|
|
|
};
|
2022-02-01 01:30:23 +00:00
|
|
|
|
2022-10-11 08:44:32 +00:00
|
|
|
config =
|
|
|
|
lib.mkIf config.environment.enable (import ./tritonshell.nix { inherit devshell pkgs self system; });
|
|
|
|
};
|
|
|
|
# Internal utility package with shell function and env vars helper.
|
|
|
|
# These get source'd in devshell.bash.extra when starting tritonshell
|
|
|
|
packages = {
|
|
|
|
triton-utils = import ./pkgs/triton-utils.nix { inherit pkgs; };
|
|
|
|
triton-docker-env =
|
|
|
|
let
|
|
|
|
# CUSTOMIZE:
|
|
|
|
# variables used to set triton env vars in tritonshell
|
|
|
|
# adjust to suit your Triton Data Center setup
|
|
|
|
# take a look at ./pkgs/triton-docker-env-shell.nix to see how these get used
|
|
|
|
cnsBaseDomain = "greenbaum.zone";
|
|
|
|
dataCenters = [ "cgn-1" "lev-1" ];
|
|
|
|
mantaDomain = "eu-central.manta.greenbaum.cloud";
|
|
|
|
tritonApiDomain = "api.greenbaum.cloud";
|
|
|
|
in
|
|
|
|
import ./pkgs/triton-docker-env.nix {
|
|
|
|
inherit pkgs cnsBaseDomain dataCenters mantaDomain tritonApiDomain;
|
2022-10-07 12:44:26 +00:00
|
|
|
};
|
2022-10-11 08:44:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2022-02-01 01:30:23 +00:00
|
|
|
}
|