Update builtin chromium appvm description

This commit is contained in:
Mikhail Klementev 2020-01-02 17:52:22 +00:00
parent 3e8a08d638
commit dbfc2929db
No known key found for this signature in database
GPG key ID: BE44DA8C062D87DC
2 changed files with 20 additions and 29 deletions

View file

@ -83,19 +83,3 @@ to crontab like that:
$ crontab -l
* * * * * /home/user/dev/go/bin/appvm autoballoon
# App description
$ cat nix/chromium.nix
{pkgs, ...}:
{
imports = [
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
<nix/base.nix>
];
services.xserver.displayManager.sessionCommands =
"while [ 1 ]; do ${pkgs.chromium}/bin/chromium; done &";
}
For create new app you should add package name (search at https://nixos.org/nixos/packages.html) and path to binary (typically same as package name).

View file

@ -15,25 +15,32 @@ var builtin_chromium_nix = app{
Name: "chromium",
Nix: []byte(`
{pkgs, ...}:
{
let
application = "${pkgs.chromium}/bin/chromium";
appRunner = pkgs.writeShellScriptBin "app" ''
ARGS_FILE=/home/user/.args
ARGS=$(cat $ARGS_FILE)
rm $ARGS_FILE
${application} $ARGS
systemctl poweroff
'';
in {
imports = [
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
<nix/base.nix>
];
environment.etc."chromium/policies/managed/plugins.json".text = ''
{
"ExtensionInstallForcelist": [
// uBlock Origin (https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm)
"cjpalhdlnbpafiamejdnhcphjbkeiagm;https://clients2.google.com/service/update2/crx",
// HTTPS Everywhere (https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp)
"gcbommkclmclpchllfjekcdonpmejbdp;https://clients2.google.com/service/update2/crx",
]
}
'';
programs.chromium = {
enable = true;
extensions = [
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
"gcbommkclmclpchllfjekcdonpmejbdp" # HTTPS Everywhere
"fihnjjcciajhdojfnbdddfaoknhalnja" # I don't care about cookies
];
};
environment.systemPackages = [ pkgs.chromium ];
services.xserver.displayManager.sessionCommands = "while [ 1 ]; do ${pkgs.chromium}/bin/chromium; done &";
services.xserver.displayManager.sessionCommands = "${appRunner}/bin/app &";
}
`),
}