Fix time-zone combinator on missing /etc/localtime
Thanks ~charlie-collard for reporting this Fixes https://todo.sr.ht/~alexdavid/jail.nix/2
This commit is contained in:
parent
b42ed9103f
commit
d596e0bc81
2 changed files with 31 additions and 6 deletions
|
|
@ -1,9 +1,8 @@
|
|||
{ combinators, ... }:
|
||||
let
|
||||
inherit (combinators)
|
||||
compose
|
||||
add-runtime
|
||||
include-once
|
||||
unsafe-add-raw-args
|
||||
;
|
||||
in
|
||||
{
|
||||
|
|
@ -11,8 +10,12 @@ in
|
|||
doc = ''
|
||||
Exposes your timezone.
|
||||
'';
|
||||
impl = include-once "time-zone" (compose [
|
||||
(unsafe-add-raw-args "--ro-bind \"$(realpath /etc/localtime)\" \"$(readlink /etc/localtime)\"")
|
||||
(unsafe-add-raw-args "--symlink \"$(readlink /etc/localtime)\" /etc/localtime")
|
||||
]);
|
||||
impl = include-once "time-zone" (add-runtime ''
|
||||
if [ -L /etc/localtime ]; then
|
||||
RUNTIME_ARGS+=(
|
||||
--ro-bind "$(realpath /etc/localtime)" "$(readlink /etc/localtime)"
|
||||
--symlink "$(readlink /etc/localtime)" /etc/localtime
|
||||
)
|
||||
fi
|
||||
'');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue