mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-12 02:00:11 +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
|
gitMinimal
|
||||||
curl
|
curl
|
||||||
ncurses
|
ncurses
|
||||||
|
less
|
||||||
|
|
||||||
cacert.out
|
cacert.out
|
||||||
|
|
||||||
|
|
@ -34,7 +35,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nixConfContents =
|
nixConfContents =
|
||||||
(lib.concatStringsSep "\n" (lib.mapAttrsFlatten (n: v: let
|
(lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: let
|
||||||
vStr =
|
vStr =
|
||||||
if builtins.isList v
|
if builtins.isList v
|
||||||
then lib.concatStringsSep " " v
|
then lib.concatStringsSep " " v
|
||||||
|
|
@ -95,6 +96,9 @@
|
||||||
echo "coder:100000:65536" > $out/etc/subuid
|
echo "coder:100000:65536" > $out/etc/subuid
|
||||||
echo "coder:100000:65536" > $out/etc/subgid
|
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 ${profile} $out/nix/var/nix/profiles/default-1-link
|
||||||
ln -s /nix/var/nix/profiles/default-1-link $out/nix/var/nix/profiles/default
|
ln -s /nix/var/nix/profiles/default-1-link $out/nix/var/nix/profiles/default
|
||||||
|
|
||||||
|
|
@ -129,6 +133,7 @@ in
|
||||||
"HOME=/home/coder"
|
"HOME=/home/coder"
|
||||||
"TMPDIR=/tmp"
|
"TMPDIR=/tmp"
|
||||||
"XDG_RUNTIME_DIR=/tmp"
|
"XDG_RUNTIME_DIR=/tmp"
|
||||||
|
"TZDIR=/etc/zoneinfo"
|
||||||
"PATH=${lib.concatStringsSep ":" [
|
"PATH=${lib.concatStringsSep ":" [
|
||||||
"/home/coder/.nix-profile/bin"
|
"/home/coder/.nix-profile/bin"
|
||||||
# this makes all the packages defined at the top available
|
# this makes all the packages defined at the top available
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,10 @@
|
||||||
name = "DOTFILES_REPO";
|
name = "DOTFILES_REPO";
|
||||||
value = "\${data.coder_parameter.dotfiles_repo.value}";
|
value = "\${data.coder_parameter.dotfiles_repo.value}";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "TZ";
|
||||||
|
value = "\${data.coder_parameter.timezone.value}";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
resources = {
|
resources = {
|
||||||
requests = {
|
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