summaryrefslogtreecommitdiffstats
path: root/modules/lass/browsers.nix
blob: 8aecea92599114aa7698c84a3d148bea084749b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ config, pkgs, ... }:

let
  mainUser = config.users.extraUsers.mainUser;

in {

  nixpkgs.config.packageOverrides = pkgs : {
    chromium = pkgs.chromium.override {
      pulseSupport = true;
    };
  };

  environment.systemPackages = with pkgs; [
    firefox
  ];

  users.extraUsers = {
    firefox = {
      name = "firefox";
      description = "user for running firefox";
      home = "/home/firefox";
      useDefaultShell = true;
      extraGroups = [ "audio" ];
      createHome = true;
    };
    chromium = {
      name = "chromium";
      description = "user for running chromium";
      home = "/home/chromium";
      useDefaultShell = true;
      extraGroups = [ "audio" ];
      createHome = true;
    };
    facebook = {
      name = "facebook";
      description = "user for running facebook in chromium";
      home = "/home/facebook";
      useDefaultShell = true;
      extraGroups = [ "audio" ];
      createHome = true;
    };
    google = {
      name = "google";
      description = "user for running google+/gmail in chromium";
      home = "/home/google";
      useDefaultShell = true;
      createHome = true;
    };
    flash = {
      name = "flash";
      description = "user for running flash stuff";
      home = "/home/flash";
      useDefaultShell = true;
      extraGroups = [ "audio" ];
      createHome = true;
    };
  };

  security.sudo.extraConfig = ''
    ${mainUser.name} ALL=(firefox) NOPASSWD: ALL
    ${mainUser.name} ALL=(chromium) NOPASSWD: ALL
    ${mainUser.name} ALL=(facebook) NOPASSWD: ALL
    ${mainUser.name} ALL=(google) NOPASSWD: ALL
    ${mainUser.name} ALL=(flash) NOPASSWD: ALL
  '';
}