nixos/captive-browser: fix startup
It seems as since Chromium 92, `chromium` crashes on startup if `XDG_CONFIG_HOME` points to a read-only (store-)path. (cherry picked from commit 8c35a69a6ea206204ddfd3116c4497020b9f2724)
This commit is contained in:
parent
39b51feb80
commit
985d2d0dec
|
@ -27,6 +27,7 @@ in
|
||||||
browser = mkOption {
|
browser = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = concatStringsSep " " [
|
default = concatStringsSep " " [
|
||||||
|
''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"''
|
||||||
''${pkgs.chromium}/bin/chromium''
|
''${pkgs.chromium}/bin/chromium''
|
||||||
''--user-data-dir=''${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive''
|
''--user-data-dir=''${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive''
|
||||||
''--proxy-server="socks5://$PROXY"''
|
''--proxy-server="socks5://$PROXY"''
|
||||||
|
@ -111,6 +112,7 @@ in
|
||||||
security.wrappers.captive-browser = {
|
security.wrappers.captive-browser = {
|
||||||
capabilities = "cap_net_raw+p";
|
capabilities = "cap_net_raw+p";
|
||||||
source = pkgs.writeShellScript "captive-browser" ''
|
source = pkgs.writeShellScript "captive-browser" ''
|
||||||
|
export PREV_CONFIG_HOME="$XDG_CONFIG_HOME"
|
||||||
export XDG_CONFIG_HOME=${pkgs.writeTextDir "captive-browser.toml" ''
|
export XDG_CONFIG_HOME=${pkgs.writeTextDir "captive-browser.toml" ''
|
||||||
browser = """${cfg.browser}"""
|
browser = """${cfg.browser}"""
|
||||||
dhcp-dns = """${cfg.dhcp-dns}"""
|
dhcp-dns = """${cfg.dhcp-dns}"""
|
||||||
|
|
Loading…
Reference in New Issue