mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-11 17:50:06 +01:00
feat: add support for changing the timezone in the container
This commit is contained in:
parent
01c163c081
commit
67d14dbbe9
3 changed files with 20 additions and 1 deletions
|
|
@ -14,6 +14,7 @@
|
|||
gitMinimal
|
||||
curl
|
||||
ncurses
|
||||
less
|
||||
|
||||
cacert.out
|
||||
|
||||
|
|
@ -34,7 +35,7 @@
|
|||
};
|
||||
|
||||
nixConfContents =
|
||||
(lib.concatStringsSep "\n" (lib.mapAttrsFlatten (n: v: let
|
||||
(lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: let
|
||||
vStr =
|
||||
if builtins.isList v
|
||||
then lib.concatStringsSep " " v
|
||||
|
|
@ -95,6 +96,9 @@
|
|||
echo "coder:100000:65536" > $out/etc/subuid
|
||||
echo "coder:100000:65536" > $out/etc/subgid
|
||||
|
||||
# support timezones
|
||||
ln -s ${pkgs.tzdata}/share/zoneinfo $out/etc/zoneinfo
|
||||
|
||||
ln -s ${profile} $out/nix/var/nix/profiles/default-1-link
|
||||
ln -s /nix/var/nix/profiles/default-1-link $out/nix/var/nix/profiles/default
|
||||
|
||||
|
|
@ -129,6 +133,7 @@ in
|
|||
"HOME=/home/coder"
|
||||
"TMPDIR=/tmp"
|
||||
"XDG_RUNTIME_DIR=/tmp"
|
||||
"TZDIR=/etc/zoneinfo"
|
||||
"PATH=${lib.concatStringsSep ":" [
|
||||
"/home/coder/.nix-profile/bin"
|
||||
# this makes all the packages defined at the top available
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@
|
|||
name = "DOTFILES_REPO";
|
||||
value = "\${data.coder_parameter.dotfiles_repo.value}";
|
||||
}
|
||||
{
|
||||
name = "TZ";
|
||||
value = "\${data.coder_parameter.timezone.value}";
|
||||
}
|
||||
];
|
||||
resources = {
|
||||
requests = {
|
||||
|
|
|
|||
|
|
@ -87,5 +87,15 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
timezone = {
|
||||
name = "Timezone";
|
||||
description = ''
|
||||
Content of the TZ environment variable.
|
||||
'';
|
||||
default = "";
|
||||
order = 8;
|
||||
type = "string";
|
||||
mutable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue