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

windows-launcher: Change spice to enableSpice #309

Merged
merged 1 commit into from
Oct 10, 2023
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
8 changes: 3 additions & 5 deletions modules/windows-launcher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
...
}: let
cfg = config.ghaf.windows-launcher;
windows-launcher = pkgs.callPackage ../../user-apps/windows-launcher {spice = cfg.spice;};
windows-launcher = pkgs.callPackage ../../user-apps/windows-launcher {enableSpice = cfg.spice;};
in {
options.ghaf.windows-launcher = {
enable = lib.mkEnableOption "Windows launcher";
};

options.ghaf.windows-launcher.spice = lib.mkOption {
description = "Enable remote access to the virtual machine using spice";
type = lib.types.bool;
default = false;
options.ghaf.windows-launcher.spice = lib.mkEnableOption {
description = "remote access to the virtual machine using spice";
};

options.ghaf.windows-launcher.spice-port = lib.mkOption {
Expand Down
3 changes: 2 additions & 1 deletion user-apps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ in
pkgs = nixpkgs.legacyPackages.${system};
in {
gala-app = pkgs.callPackage ./gala {};
windows-launcher = pkgs.callPackage ./windows-launcher {};
windows-launcher = pkgs.callPackage ./windows-launcher {enableSpice = false;};
windows-launcher-spice = pkgs.callPackage ./windows-launcher {enableSpice = true;};
};
}))
]
8 changes: 4 additions & 4 deletions user-apps/windows-launcher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgs,
lib,
stdenv,
spice ? false,
enableSpice ? false,
...
}: let
ovmfPrefix =
Expand All @@ -32,7 +32,7 @@
exit
fi
''
+ lib.optionalString (!spice) ''
+ lib.optionalString (!enableSpice) ''
if [[ -z "''${WAYLAND_DISPLAY}" ]]; then
echo "Wayland display not found"
exit
Expand Down Expand Up @@ -68,13 +68,13 @@
"-drive file=$OVMF_CODE,format=raw,if=pflash,readonly=on"
"-drive file=$OVMF_VARS,format=raw,if=pflash"
''
+ lib.optionalString (!spice) ''
+ lib.optionalString (!enableSpice) ''
"-vga none"
"-device ramfb"
"-device virtio-gpu-pci"
"-nic user,model=virtio"
''
+ lib.optionalString spice ''
+ lib.optionalString enableSpice ''
"-vga qxl"
"-device virtio-serial-pci"
"-spice port=5900,addr=0.0.0.0,disable-ticketing=on"
Expand Down