l browsers: use new xjail interface

This commit is contained in:
lassulus 2018-04-01 16:19:28 +02:00
parent 0f47b98e81
commit 1a5b58c828

View File

@ -21,14 +21,10 @@ let
$BIN "$@" $BIN "$@"
''; '';
createChromiumUser = name: groups: precedence: createUser = script: name: groups: precedence: dpi:
{ {
lass.xjail.${name} = { lass.xjail.${name} = {
user = name; inherit script groups dpi;
script = pkgs.writeDash name ''
${pkgs.chromium}/bin/chromium "$@"
'';
inherit groups;
}; };
environment.systemPackages = [ config.lass.xjail-bins.${name} ]; environment.systemPackages = [ config.lass.xjail-bins.${name} ];
lass.browser.paths.${name} = { lass.browser.paths.${name} = {
@ -37,40 +33,20 @@ let
}; };
}; };
createChromiumUser = name: groups: precedence:
createUser (pkgs.writeDash name ''
${pkgs.chromium}/bin/chromium "$@"
'') name groups precedence 80;
createFirefoxUser = name: groups: precedence: createFirefoxUser = name: groups: precedence:
{ createUser (pkgs.writeDash name ''
lass.xjail.${name} = { ${pkgs.firefox-devedition-bin}/bin/firefox-devedition "$@"
user = name; '') name groups precedence 80;
script = pkgs.writeDash name ''
${pkgs.firefox-devedition-bin}/bin/firefox-devedition "$@"
'';
inherit groups;
};
environment.systemPackages = [ config.lass.xjail-bins.${name} ];
lass.browser.paths.${name} = {
path = config.lass.xjail-bins.${name};
inherit precedence;
};
};
createQuteUser = name: groups: precedence: createQuteUser = name: groups: precedence:
{ createUser (pkgs.writeDash name ''
lass.xjail.${name} = { ${pkgs.qutebrowser}/bin/qutebrowser "$@"
user = name; '') name groups precedence 60;
script = pkgs.writeDash name ''
${pkgs.qutebrowser}/bin/qutebrowser "$@"
'';
inherit groups;
};
environment.systemPackages = [ config.lass.xjail-bins.${name} ];
lass.browser.paths.${name} = {
path = config.lass.xjail-bins.${name};
inherit precedence;
};
};
#TODO: abstract this
in { in {