How to install Glamorous Toolkit with Nix
This documentation focusses on NixOS, but can also be used with the Nix package manager on other distributions.
There are two primary methods for running GT on NixOS, each with its own advantages and disadvantages:
Nix package.
This has the advantage that it is always available, but may not contain the latest VM version.
Note that if a new VM has just been released it is straightforward to install the latest VM using an overlay, see below.
Using an FHS environment to run the executables distributed with GT.
This has the advantage that the matching VM will always be used with a given image, and mulltiple versions of the VM can be used at once, but has the disadvantage that you are operating in something of a sandboxed environment, e.g. there are restrictions on sudo.
Glamorous Toolkit is packaged in Nix so can be installed simply by listing it in systemPackages. Currently only the x86_64 architecture is supported.
However as updated Virtual Machine's are released fairly regularly, we recommend installing GT from the unstable channel.
If you are using the unstable channel you should be able to just add glamoroustoolkit to your list of packages:
environment.systemPackages = with pkgs; [
# ...
glamoroustoolkit
# ...
];
If you are using the stable channel and don't already have unstable configured:
{ config, pkgs, ... }:
let
# Define the unstable channel, reusing the current config
unstable = import
(builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixpkgs-unstable) { config = config.nixpkgs.config; };
in
{
environment.systemPackages = with pkgs; [
# ...
unstable.glamoroustoolkit
# ...
];
}
If a new VM with a breaking change has been released and the updated package isn't yet available in the unstable channel, it is straightforward to use an overlay to specify the desired VM, see below.
After the package is installed the following commands are available:
GlamorousToolkit-GetImage
A simple script to install the latest image in to the current working directory.
GlamorousToolkit and GlamorousToolkit-cli
The GUI and CLI versions of the command line.
A specific version of the GT VM can be installed with an overlay similar to:
(final: prev: {
glamoroustoolkit = prev.glamoroustoolkit.overrideAttrs (old: {
version = "1.1.3";
src = prev.fetchzip {
url = "https://github.com/feenkcom/gtoolkit-vm/releases/download/v1.1.3/GlamorousToolkit-x86_64-unknown-linux-gnu.zip";
stripRoot = false;
hash = "sha256-vVHdYspwBldzB6FiMQRsDr27zXcybsfMfo5SuwClkNM=";
};
});
})
If you don't have the hash of the desired version, don't forget to use an empty hash initially to report the new hash, otherwise an old version of the VM will be installed.
If you have a need to run multiple versions of the GT VM, there are a few options. One is to install multiple versions using overlays and link to the VM with a versioned name (this method isn't covered here). Another approach is to set up an FHS environment, allowing the executables delivered with GT to be used directly.
To do this, create a file, e.g. gt-fhs.nix:
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSEnv {
name = "GlamorousToolkit";
targetPkgs = pkgs: (with pkgs; [
bash
coreutils
gcc
iputils
libcap
curl
libxcrypt-legacy
fontconfig
freetype
libz
linux-pam
rpcbind
which
zip
cairo
dbus
glib
gtk3
libgit2
libglvnd
libuuid
harfbuzz
libsoup_3
webkitgtk_4_1
zenity
libxkbcommon
]) ++ (with pkgs.xorg; [
libX11
libXft
libxcb
libXcursor
libXext
libXi
libXrandr
libXrender
]);
runScript = "zsh";
}).env
and then open a shell:
nix-shell gt-fhs.nix
at that point you have a shell that can run the GT executables, e.g.:
bin/GlamorousToolkit-cli --interactive --enable-wayland --beacon ERROR GlamorousToolkit.image
This has the advantage that the paired image and VM can be used together and mulltiple versions of the VM can be used at once, but has the disadvantage that you are operating in something of a sandboxed environment, e.g. there are restrictions on sudo.