Skip to content

Instantly share code, notes, and snippets.

@newtolinux23
Created July 4, 2024 19:37
Show Gist options
  • Select an option

  • Save newtolinux23/a64eac30135d921924f1f93d6b73fb9d to your computer and use it in GitHub Desktop.

Select an option

Save newtolinux23/a64eac30135d921924f1f93d6b73fb9d to your computer and use it in GitHub Desktop.
Issue with Enabling Dynamic Workspaces in GNOME on NixOS

Resolving Dynamic Workspaces Issue in NixOS GNOME

Description

This document details the issue I faced with enabling dynamic workspaces in GNOME on NixOS and how I resolved it using `dconf` directly.

Table of Contents

  1. The Issue
  2. Attempted Solutions
  3. Final Solution Using dconf
  4. Conclusion

The Issue

When trying to enable dynamic workspaces in GNOME on NixOS using the `gsettings` command, I encountered the following error:

No such schema “org.gnome.mutter”

This indicated that the `org.gnome.mutter` schema was not available on my system, preventing me from enabling dynamic workspaces through the usual method.

Attempted Solutions

I tried several approaches to resolve this issue:

  1. Ensuring GNOME was fully installed: I updated my `/etc/nixos/configuration.nix` to include the necessary GNOME components and rebuilt my system.
{ config, pkgs, ... }:

{
  services.xserver.enable = true;
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  environment.systemPackages = with pkgs; [
    gnome3.gnome-tweaks
    dconf
    gnome3.gnome-shell
  ];
}
  1. Rebooting the system: After making the configuration changes, I rebooted my system to ensure all changes took effect.
  2. Verifying GNOME session: I checked to ensure I was logged into a GNOME session using the following command:
echo $XDG_CURRENT_DESKTOP

Despite these steps, the `gsettings` command still did not recognize the `org.gnome.mutter` schema.

Final Solution Using dconf

Given the persistent issue with `gsettings`, I decided to use `dconf` directly to enable dynamic workspaces.

  1. Install `dconf` CLI tool:
nix-env -iA nixos.dconf
  1. Set dynamic workspaces using `dconf`:
dconf write /org/gnome/mutter/dynamic-workspaces true

This command successfully enabled dynamic workspaces in GNOME, resolving the issue.

Conclusion

By using the `dconf` CLI tool, I was able to work around the limitations with `gsettings` and enable dynamic workspaces in GNOME on NixOS. This experience highlighted the importance of having alternative tools and methods for configuring system settings when the primary tools do not work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment