mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-22 20:23:01 +00:00
Update builtin chromium appvm description
This commit is contained in:
parent
3e8a08d638
commit
dbfc2929db
16
README.md
16
README.md
@ -83,19 +83,3 @@ to crontab like that:
|
|||||||
|
|
||||||
$ crontab -l
|
$ crontab -l
|
||||||
* * * * * /home/user/dev/go/bin/appvm autoballoon
|
* * * * * /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).
|
|
||||||
|
33
builtin.go
33
builtin.go
@ -15,25 +15,32 @@ var builtin_chromium_nix = app{
|
|||||||
Name: "chromium",
|
Name: "chromium",
|
||||||
Nix: []byte(`
|
Nix: []byte(`
|
||||||
{pkgs, ...}:
|
{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 = [
|
imports = [
|
||||||
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
|
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
|
||||||
<nix/base.nix>
|
<nix/base.nix>
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.etc."chromium/policies/managed/plugins.json".text = ''
|
programs.chromium = {
|
||||||
{
|
enable = true;
|
||||||
"ExtensionInstallForcelist": [
|
extensions = [
|
||||||
// uBlock Origin (https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm)
|
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
|
||||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm;https://clients2.google.com/service/update2/crx",
|
"gcbommkclmclpchllfjekcdonpmejbdp" # HTTPS Everywhere
|
||||||
// HTTPS Everywhere (https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp)
|
"fihnjjcciajhdojfnbdddfaoknhalnja" # I don't care about cookies
|
||||||
"gcbommkclmclpchllfjekcdonpmejbdp;https://clients2.google.com/service/update2/crx",
|
];
|
||||||
]
|
};
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.chromium ];
|
services.xserver.displayManager.sessionCommands = "${appRunner}/bin/app &";
|
||||||
services.xserver.displayManager.sessionCommands = "while [ 1 ]; do ${pkgs.chromium}/bin/chromium; done &";
|
|
||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user