Apply nixpkgs-fmt
This commit is contained in:
parent
77152c7b4a
commit
1df414c615
|
@ -6,54 +6,54 @@
|
|||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = { self, flake-utils, devshell, nixpkgs }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
in
|
||||
{
|
||||
# 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;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default =
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
overlays = [
|
||||
devshell.overlay
|
||||
(import ./overlay.nix)
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
# 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;
|
||||
};
|
||||
};
|
||||
|
||||
# HINT: add your extra devshell pkgs here, use any packages you want
|
||||
# available in your devshell's PATH
|
||||
# Use https://search.nixos.org/packages to find available packages
|
||||
# in the unstable channel
|
||||
# These get appended to devshell.packages in ./tritonshell.nix
|
||||
extraDevshellPkgs = with pkgs; [
|
||||
#hello
|
||||
];
|
||||
devShells.default =
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
in
|
||||
import ./tritonshell.nix { inherit extraDevshellPkgs devshell pkgs self system; };
|
||||
overlays = [
|
||||
devshell.overlay
|
||||
(import ./overlay.nix)
|
||||
];
|
||||
};
|
||||
|
||||
# HINT: add your extra devshell pkgs here, use any packages you want
|
||||
# available in your devshell's PATH
|
||||
# Use https://search.nixos.org/packages to find available packages
|
||||
# in the unstable channel
|
||||
# These get appended to devshell.packages in ./tritonshell.nix
|
||||
extraDevshellPkgs = with pkgs; [
|
||||
#hello
|
||||
];
|
||||
|
||||
in
|
||||
import ./tritonshell.nix { inherit extraDevshellPkgs devshell pkgs self system; };
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
{ pkgs, cnsBaseDomain, dataCenters, mantaDomain, tritonApiDomain, ... }:
|
||||
with pkgs.nodePackages;
|
||||
''
|
||||
export PATH="${triton}/bin:${json}/bin:$PATH"
|
||||
# script to set the docker, triton, manta and CNS env vars for the current
|
||||
# triton profile
|
||||
export PATH="${triton}/bin:${json}/bin:$PATH"
|
||||
# script to set the docker, triton, manta and CNS env vars for the current
|
||||
# triton profile
|
||||
|
||||
# set triton and docker host environment variables
|
||||
eval "$(triton env)"
|
||||
# set triton and docker host environment variables
|
||||
eval "$(triton env)"
|
||||
|
||||
# get the user's UUID
|
||||
triton_account_uuid="$(triton account get --json | json id)"
|
||||
# get the user's UUID
|
||||
triton_account_uuid="$(triton account get --json | json id)"
|
||||
|
||||
# set the CNS (container name service) base for auto-generated DNS records
|
||||
# in public and private networks
|
||||
# note, this makes assumptions that only work if you configured the nix
|
||||
# variables in flake.nix "CUSTOMIZE" section according to your Triton Data
|
||||
# Center setup
|
||||
for dc in ${pkgs.lib.concatStringsSep " " dataCenters}; do
|
||||
if env | grep -q -E "SDC_URL=https://''${dc}.${tritonApiDomain}"; then
|
||||
export \
|
||||
TRITON_CNS_SEARCH_DOMAIN_PUBLIC="''${triton_account_uuid}.''${dc}.${cnsBaseDomain}" \
|
||||
TRITON_CNS_SEARCH_DOMAIN_PRIVATE="''${triton_account_uuid}.''${dc}.int.${cnsBaseDomain}" \
|
||||
TRITON_DC=''$dc
|
||||
fi
|
||||
done
|
||||
# set the CNS (container name service) base for auto-generated DNS records
|
||||
# in public and private networks
|
||||
# note, this makes assumptions that only work if you configured the nix
|
||||
# variables in flake.nix "CUSTOMIZE" section according to your Triton Data
|
||||
# Center setup
|
||||
for dc in ${pkgs.lib.concatStringsSep " " dataCenters}; do
|
||||
if env | grep -q -E "SDC_URL=https://''${dc}.${tritonApiDomain}"; then
|
||||
export \
|
||||
TRITON_CNS_SEARCH_DOMAIN_PUBLIC="''${triton_account_uuid}.''${dc}.${cnsBaseDomain}" \
|
||||
TRITON_CNS_SEARCH_DOMAIN_PRIVATE="''${triton_account_uuid}.''${dc}.int.${cnsBaseDomain}" \
|
||||
TRITON_DC=''$dc
|
||||
fi
|
||||
done
|
||||
|
||||
export MANTA_URL=https://${mantaDomain}
|
||||
export MANTA_USER=$SDC_ACCOUNT
|
||||
export MANTA_KEY_ID=$SDC_KEY_ID
|
||||
export MANTA_URL=https://${mantaDomain}
|
||||
export MANTA_USER=$SDC_ACCOUNT
|
||||
export MANTA_KEY_ID=$SDC_KEY_ID
|
||||
''
|
||||
|
|
|
@ -5,10 +5,10 @@ pkgs.stdenv.mkDerivation {
|
|||
src = pkgs.lib.cleanSource ./.;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share/certs
|
||||
cd ./utils
|
||||
cp ./cacert-2022-04-26.pem $out/share/certs
|
||||
cp ./ttp.sh $out/bin
|
||||
cp ./unset-env.sh $out/bin
|
||||
mkdir -p $out/bin $out/share/certs
|
||||
cd ./utils
|
||||
cp ./cacert-2022-04-26.pem $out/share/certs
|
||||
cp ./ttp.sh $out/bin
|
||||
cp ./unset-env.sh $out/bin
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue