-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: vms for testing ghostty (#4608)
Adds a Nix VM configuration to run Gnome/Wayland. The primary purpose will be testing Ghostty in a "clean" environment. I'm going to continue to experiment with running this in CI to see if we can do some basic testing of GTK since it's difficult to unit test that code. To use, run `nix run .#wayland-gnome` in the Ghostty source directory. I have no idea if this works on macOS. There's probably a lot of extra stuff that can be trimmed to slim it down. Whatever directory you run this from will be mounted at `/tmp/shared` in the VM. The `ghostty` user runs as uid/gid 1000/1000 so that may affect your ability to read/write that directory if your host system user runs as a different uid/gid. If this is something that we'd like to keep, we should add VM definitions for KDE Plasma and maybe one tiling window manager. https://github.com/user-attachments/assets/57190913-f338-4383-93aa-90c9e351543d
- Loading branch information
Showing
20 changed files
with
583 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ test/cases/**/*.actual.png | |
glad.zip | ||
/Box_test.ppm | ||
/Box_test_diff.ppm | ||
/ghostty.qcow2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{...}: { | ||
imports = [ | ||
./common.nix | ||
]; | ||
|
||
services.xserver = { | ||
displayManager = { | ||
lightdm = { | ||
enable = true; | ||
}; | ||
}; | ||
desktopManager = { | ||
cinnamon = { | ||
enable = true; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
imports = [ | ||
./common.nix | ||
]; | ||
|
||
services.xserver = { | ||
displayManager = { | ||
gdm = { | ||
enable = true; | ||
autoSuspend = false; | ||
}; | ||
}; | ||
desktopManager = { | ||
gnome = { | ||
enable = true; | ||
}; | ||
}; | ||
}; | ||
|
||
environment.systemPackages = [ | ||
pkgs.gnomeExtensions.no-overview | ||
]; | ||
|
||
environment.gnome.excludePackages = with pkgs; [ | ||
atomix | ||
baobab | ||
cheese | ||
epiphany | ||
evince | ||
file-roller | ||
geary | ||
gnome-backgrounds | ||
gnome-calculator | ||
gnome-calendar | ||
gnome-clocks | ||
gnome-connections | ||
gnome-contacts | ||
gnome-disk-utility | ||
gnome-extension-manager | ||
gnome-logs | ||
gnome-maps | ||
gnome-music | ||
gnome-photos | ||
gnome-software | ||
gnome-system-monitor | ||
gnome-text-editor | ||
gnome-themes-extra | ||
gnome-tour | ||
gnome-user-docs | ||
gnome-weather | ||
hitori | ||
iagno | ||
loupe | ||
nautilus | ||
orca | ||
seahorse | ||
simple-scan | ||
snapshot | ||
sushi | ||
tali | ||
totem | ||
yelp | ||
]; | ||
|
||
programs.dconf = { | ||
enable = true; | ||
profiles.user.databases = [ | ||
{ | ||
settings = with lib.gvariant; { | ||
"org/gnome/desktop/background" = { | ||
picture-uri = "file://${pkgs.ghostty}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png"; | ||
picture-uri-dark = "file://${pkgs.ghostty}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png"; | ||
picture-options = "centered"; | ||
primary-color = "#000000000000"; | ||
secondary-color = "#000000000000"; | ||
}; | ||
"org/gnome/desktop/interface" = { | ||
color-scheme = "prefer-dark"; | ||
}; | ||
"org/gnome/desktop/notifications" = { | ||
show-in-lock-screen = false; | ||
}; | ||
"org/gnome/desktop/screensaver" = { | ||
lock-enabled = false; | ||
picture-uri = "file://${pkgs.ghostty}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png"; | ||
picture-options = "centered"; | ||
primary-color = "#000000000000"; | ||
secondary-color = "#000000000000"; | ||
}; | ||
"org/gnome/desktop/session" = { | ||
idle-delay = mkUint32 0; | ||
}; | ||
"org/gnome/shell" = { | ||
disable-user-extensions = false; | ||
enabled-extensions = builtins.map (x: x.extensionUuid) ( | ||
lib.filter (p: p ? extensionUuid) config.environment.systemPackages | ||
); | ||
}; | ||
}; | ||
} | ||
]; | ||
}; | ||
|
||
programs.geary.enable = false; | ||
|
||
services.gnome = { | ||
gnome-browser-connector.enable = false; | ||
gnome-initial-setup.enable = false; | ||
gnome-online-accounts.enable = false; | ||
gnome-remote-desktop.enable = false; | ||
rygel.enable = false; | ||
}; | ||
|
||
system.activationScripts = { | ||
face = { | ||
text = '' | ||
mkdir -p /var/lib/AccountsService/{icons,users} | ||
cp ${pkgs.ghostty}/share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png /var/lib/AccountsService/icons/ghostty | ||
echo -e "[User]\nIcon=/var/lib/AccountsService/icons/ghostty\n" > /var/lib/AccountsService/users/ghostty | ||
chown root:root /var/lib/AccountsService/users/ghostty | ||
chmod 0600 /var/lib/AccountsService/users/ghostty | ||
chown root:root /var/lib/AccountsService/icons/ghostty | ||
chmod 0444 /var/lib/AccountsService/icons/ghostty | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{...}: { | ||
imports = [ | ||
./common.nix | ||
]; | ||
|
||
services = { | ||
displayManager = { | ||
sddm = { | ||
enable = true; | ||
wayland = { | ||
enable = true; | ||
}; | ||
}; | ||
}; | ||
desktopManager = { | ||
plasma6 = { | ||
enable = true; | ||
}; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.