stockholm/lass/2configs/browsers.nix

51 lines
1.2 KiB
Nix
Raw Normal View History

2015-08-28 14:31:05 +00:00
{ config, lib, pkgs, ... }:
2015-07-16 13:51:01 +00:00
let
2015-08-28 14:31:05 +00:00
inherit (import ../4lib { inherit pkgs lib; }) simpleScript;
2015-07-16 13:51:01 +00:00
mainUser = config.users.extraUsers.mainUser;
2015-08-28 14:31:05 +00:00
createBrowserUser = name: extraGroups: packages:
{
users.extraUsers = {
${name} = {
inherit name;
inherit extraGroups;
home = "/home/${name}";
useDefaultShell = true;
createHome = true;
};
};
lass.per-user.${name}.packages = packages;
security.sudo.extraConfig = ''
${mainUser.name} ALL=(${name}) NOPASSWD: ALL
'';
environment.systemPackages = [
(simpleScript name ''
sudo -u ${name} -i chromium $@
'')
];
};
2015-07-16 13:51:01 +00:00
in {
2015-08-28 14:31:05 +00:00
imports = [
../3modules/per-user.nix
] ++ [
( createBrowserUser "ff" [ "audio" ] [ pkgs.firefox ] )
( createBrowserUser "cr" [ "audio" ] [ pkgs.chromium ] )
( createBrowserUser "fb" [ ] [ pkgs.chromium ] )
( createBrowserUser "gm" [ ] [ pkgs.chromium ] )
( createBrowserUser "flash" [ ] [ pkgs.flash ] )
2015-07-16 13:51:01 +00:00
];
2015-08-28 14:31:05 +00:00
nixpkgs.config.packageOverrides = pkgs : {
flash = pkgs.chromium.override {
pulseSupport = true;
enablePepperFlash = true;
2015-07-16 13:51:01 +00:00
};
2015-08-28 14:31:05 +00:00
chromium = pkgs.chromium.override {
pulseSupport = true;
2015-07-16 13:51:01 +00:00
};
};
}