summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-03-28 21:13:57 +0200
committerlassulus <lassulus@lassul.us>2018-03-28 21:29:57 +0200
commit30068c17c9c8dc807feab2856b40012c3fffcce4 (patch)
tree1681ca7407016689414856ca7117dc0999303644
parent92540f5cf1628cfaceee6c19f08b3c13b05cf6b4 (diff)
l browsers: use xjails
-rw-r--r--lass/2configs/browsers.nix77
1 files changed, 37 insertions, 40 deletions
diff --git a/lass/2configs/browsers.nix b/lass/2configs/browsers.nix
index cbbd54b6b..153c386cf 100644
--- a/lass/2configs/browsers.nix
+++ b/lass/2configs/browsers.nix
@@ -21,58 +21,55 @@ let
$BIN "$@"
'';
- createChromiumUser = name: extraGroups: precedence:
- let
- bin = pkgs.writeScriptBin name ''
- /var/run/wrappers/bin/sudo -u ${name} -i ${pkgs.chromium}/bin/chromium $@
- '';
- in {
- users.extraUsers.${name} = {
- inherit name;
- inherit extraGroups;
- home = "/home/${name}";
- uid = genid name;
- useDefaultShell = true;
- createHome = true;
+ createChromiumUser = name: groups: precedence:
+ {
+ lass.xjail.${name} = {
+ user = name;
+ script = pkgs.writeDash name ''
+ ${pkgs.chromium}/bin/chromium "$@"
+ '';
+ inherit groups;
+ };
+ environment.systemPackages = [ config.lass.xjail-bins.${name} ];
+ lass.browser.paths.${name} = {
+ path = config.lass.xjail-bins.${name};
+ inherit precedence;
+ };
+ };
+
+ createFirefoxUser = name: groups: precedence:
+ {
+ lass.xjail.${name} = {
+ user = name;
+ 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 = bin;
+ path = config.lass.xjail-bins.${name};
inherit precedence;
};
- security.sudo.extraConfig = ''
- ${mainUser.name} ALL=(${name}) NOPASSWD: ALL
- '';
- environment.systemPackages = [
- bin
- ];
};
- createFirefoxUser = name: extraGroups: precedence:
- let
- bin = pkgs.writeScriptBin name ''
- /var/run/wrappers/bin/sudo -u ${name} -i ${pkgs.firefox-devedition-bin}/bin/firefox-devedition $@
- '';
- in {
- users.extraUsers.${name} = {
- inherit name;
- inherit extraGroups;
- home = "/home/${name}";
- uid = genid name;
- useDefaultShell = true;
- createHome = true;
+ createQuteUser = name: groups: precedence:
+ {
+ lass.xjail.${name} = {
+ user = name;
+ script = pkgs.writeDash name ''
+ ${pkgs.qutebrowser}/bin/qutebrowser "$@"
+ '';
+ inherit groups;
};
+ environment.systemPackages = [ config.lass.xjail-bins.${name} ];
lass.browser.paths.${name} = {
- path = bin;
+ path = config.lass.xjail-bins.${name};
inherit precedence;
};
- security.sudo.extraConfig = ''
- ${mainUser.name} ALL=(${name}) NOPASSWD: ALL
- '';
- environment.systemPackages = [
- bin
- ];
};
+
#TODO: abstract this
in {