From 4a6a8b1f7a286c4354d7a0e8c2dcb3fcb6601479 Mon Sep 17 00:00:00 2001 From: Mika Tammi Date: Sat, 7 Oct 2023 15:36:08 +0300 Subject: [PATCH] windows-launcher: Change spice to enableSpice Change spice to enableSpice in package arguments. This is because there exists a package called spice, so when called through callPackage the spice argument gets filled with that package, instead of defaulting to false. Signed-off-by: Mika Tammi --- modules/windows-launcher/default.nix | 8 +++----- user-apps/default.nix | 3 ++- user-apps/windows-launcher/default.nix | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/windows-launcher/default.nix b/modules/windows-launcher/default.nix index 049d601f2..d01e0448a 100644 --- a/modules/windows-launcher/default.nix +++ b/modules/windows-launcher/default.nix @@ -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 { diff --git a/user-apps/default.nix b/user-apps/default.nix index 11e41a88b..7075226fa 100644 --- a/user-apps/default.nix +++ b/user-apps/default.nix @@ -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;}; }; })) ] diff --git a/user-apps/windows-launcher/default.nix b/user-apps/windows-launcher/default.nix index 5e6214256..ad748a33c 100644 --- a/user-apps/windows-launcher/default.nix +++ b/user-apps/windows-launcher/default.nix @@ -5,7 +5,7 @@ pkgs, lib, stdenv, - spice ? false, + enableSpice ? false, ... }: let ovmfPrefix = @@ -32,7 +32,7 @@ exit fi '' - + lib.optionalString (!spice) '' + + lib.optionalString (!enableSpice) '' if [[ -z "''${WAYLAND_DISPLAY}" ]]; then echo "Wayland display not found" exit @@ -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"