mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-30 12:01:29 +00:00
Embed builtin description for apps
This commit is contained in:
parent
3416808444
commit
99bd71b80c
7
appvm.go
7
appvm.go
|
@ -372,7 +372,12 @@ func main() {
|
||||||
|
|
||||||
os.MkdirAll(configDir+"/nix", 0700)
|
os.MkdirAll(configDir+"/nix", 0700)
|
||||||
|
|
||||||
err := ioutil.WriteFile(configDir+"/nix/base.nix", base_nix, 0644)
|
err := writeBuiltinApps(configDir + "/nix")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = ioutil.WriteFile(configDir+"/nix/base.nix", base_nix, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Builtin VMs
|
||||||
|
|
||||||
|
type app struct {
|
||||||
|
Name string
|
||||||
|
Nix []byte
|
||||||
|
}
|
||||||
|
|
||||||
|
var builtin_chromium_nix = app{
|
||||||
|
Name: "chromium",
|
||||||
|
Nix: []byte(`
|
||||||
{pkgs, ...}:
|
{pkgs, ...}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -19,3 +35,18 @@
|
||||||
environment.systemPackages = [ pkgs.chromium ];
|
environment.systemPackages = [ pkgs.chromium ];
|
||||||
services.xserver.displayManager.sessionCommands = "while [ 1 ]; do ${pkgs.chromium}/bin/chromium; done &";
|
services.xserver.displayManager.sessionCommands = "while [ 1 ]; do ${pkgs.chromium}/bin/chromium; done &";
|
||||||
}
|
}
|
||||||
|
`),
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeBuiltinApps(path string) (err error) {
|
||||||
|
for _, f := range []app{
|
||||||
|
builtin_chromium_nix,
|
||||||
|
} {
|
||||||
|
err = ioutil.WriteFile(configDir+"/nix/"+f.Name+".nix", f.Nix, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
Loading…
Reference in a new issue