fhs-userenv: refactor envvars and propagate SSL_CERT_FILE
This commit is contained in:
parent
de487c5c99
commit
97931361d7
@ -17,6 +17,15 @@ mounts = [ ['/nix/store', nil],
|
|||||||
mkdirs = ['tmp',
|
mkdirs = ['tmp',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Propagate environment variables
|
||||||
|
envvars = [ 'TERM',
|
||||||
|
'DISPLAY',
|
||||||
|
'HOME',
|
||||||
|
'XDG_RUNTIME_DIR',
|
||||||
|
'LANG',
|
||||||
|
'SSL_CERT_FILE',
|
||||||
|
]
|
||||||
|
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
@ -120,12 +129,7 @@ if $cpid == 0
|
|||||||
link_swdir.call swdir, Pathname.new('')
|
link_swdir.call swdir, Pathname.new('')
|
||||||
|
|
||||||
# New environment
|
# New environment
|
||||||
ENV.replace({ 'TERM' => ENV['TERM'],
|
ENV.replace(Hash[ envvars.map { |x| [x, ENV[x]] } ])
|
||||||
'DISPLAY' => ENV['DISPLAY'],
|
|
||||||
'HOME' => ENV['HOME'],
|
|
||||||
'XDG_RUNTIME_DIR' => ENV['XDG_RUNTIME_DIR'],
|
|
||||||
'LANG' => ENV['LANG'],
|
|
||||||
})
|
|
||||||
|
|
||||||
# Finally, exec!
|
# Finally, exec!
|
||||||
exec *execp
|
exec *execp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user