Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Appflowy as an example of Flutter application. #567

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/icons/png/appflowy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions assets/icons/svg/appflowy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion modules/desktop/graphics/demo-apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ in {
gala-app = mkProgramOption "Gala App" false;
element-desktop = mkProgramOption "Element desktop" config.ghaf.graphics.enableDemoApplications;
zathura = mkProgramOption "zathura" config.ghaf.graphics.enableDemoApplications;
appflowy = mkProgramOption "Appflowy" config.ghaf.graphics.enableDemoApplications;
};

config = lib.mkIf config.ghaf.profiles.graphics.enable {
Expand Down Expand Up @@ -67,12 +68,18 @@ in {
name = "zathura";
path = "${pkgs.zathura}/bin/zathura";
icon = "${pkgs.zathura}/share/icons/hicolor/32x32/apps/org.pwmt.zathura.png";
}
++ lib.optional (cfg.appflowy && pkgs.stdenv.isx86_64) {
name = "appflowy";
path = "${pkgs.appflowy}/bin/appflowy";
icon = ../../../assets/icons/svg/appflowy.svg;
};
environment.systemPackages =
lib.optional cfg.chromium pkgs.chromium
++ lib.optional cfg.element-desktop pkgs.element-desktop
++ lib.optional cfg.firefox pkgs.firefox
++ lib.optional cfg.gala-app pkgs.gala-app
++ lib.optional cfg.zathura pkgs.zathura;
++ lib.optional cfg.zathura pkgs.zathura
++ lib.optional (cfg.appflowy && pkgs.stdenv.isx86_64) pkgs.appflowy;
};
}
20 changes: 20 additions & 0 deletions targets/lenovo-x1/appvms/appflowy.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
{
pkgs,
config,
...
}: {
name = "appflowy";
packages = [pkgs.appflowy];
macAddress = "02:00:00:03:08:01";
ramMb = 512;
cores = 1;
extraModules = [
{
hardware.opengl.enable = true;
time.timeZone = config.time.timeZone;
}
];
}
27 changes: 20 additions & 7 deletions targets/lenovo-x1/appvms/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Copyright 2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
{pkgs, ...}: let
{
pkgs,
config,
...
}: let
chromium = import ./chromium.nix {inherit pkgs;};
gala = import ./gala.nix {inherit pkgs;};
zathura = import ./zathura.nix {inherit pkgs;};
element = import ./element.nix {inherit pkgs;};
in [
chromium
gala
zathura
element
]
includeAppflowy = pkgs.stdenv.isx86_64;
appflowy =
if includeAppflowy
then import ./appflowy.nix {inherit pkgs config;}
else {};
appvms =
[
chromium
gala
zathura
element
]
++ pkgs.lib.optional includeAppflowy appflowy;
in
appvms
2 changes: 1 addition & 1 deletion targets/lenovo-x1/everything.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
};
virtualization.microvm.appvm = {
enable = true;
vms = import ./appvms/default.nix {inherit pkgs;};
vms = import ./appvms/default.nix {inherit pkgs config;};
};

# Enable all the default UI applications
Expand Down
6 changes: 6 additions & 0 deletions targets/lenovo-x1/guivmExtraModules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
icon = "${../../assets/icons/png/element.png}";
}

{
name = "appflowy";
path = "${pkgs.openssh}/bin/ssh -i ${configH.ghaf.security.sshKeys.sshKeyPath} -o StrictHostKeyChecking=no appflowy-vm.ghaf run-waypipe appflowy";
icon = "${../../assets/icons/svg/appflowy.svg}";
}

{
name = "windows";
path = "${pkgs.virt-viewer}/bin/remote-viewer -f spice://${winConfig.spice-host}:${toString winConfig.spice-port}";
Expand Down