Test devshellModules

This commit is contained in:
jhonas 2022-10-07 14:44:26 +02:00
parent 7c99c7843d
commit aa428101e8
Signed by: teutat3s
GPG key ID: 924889A86D0B0FEB

View file

@ -19,27 +19,13 @@
}; };
in in
{ {
# Internal utility package with shell function and env vars helper. devshellModules.tritonshell = { config, lib, ... }: {
# These get source'd in devshell.bash.extra when starting tritonshell options.environment = {
packages = { enable = lib.mkEnableOption "environment";
triton-utils = import ./pkgs/triton-utils.nix { inherit pkgs; }; # TODO: add real config here
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;
};
}; };
config =
devShells.default = # TODO: set some devshell config here, like add a new command
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -59,7 +45,30 @@
#hello #hello
]; ];
in in
import ./tritonshell.nix { inherit extraDevshellPkgs devshell pkgs self system; }; lib.optionalAttrs config.environment.enable {
devShells.default =
(import ./tritonshell.nix { inherit extraDevshellPkgs 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;
};
};
}); });
} }