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

bug: (undocumented) gnome-terminal profile <name> must be UUID #3923

Closed
2 tasks done
MichaelMMacLeod opened this issue Apr 26, 2023 · 3 comments
Closed
2 tasks done
Assignees
Labels
bug status: stale triage Issues or feature request that have not been triaged yet

Comments

@MichaelMMacLeod
Copy link

MichaelMMacLeod commented Apr 26, 2023

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

Configuring gnome-terminal requires that <name> in profile.<name>.<option> be a UUID (any UUID works), but this is not documented. If it is anything other than a UUID then the profile will not be shown in the options or activated (even if it is marked as default).

For example, the following configuration correctly creates a profile whose visible name is "profile1":

programs.gnome-terminal = {
  enable = true;
  profile."060efe23-3ab4-4c71-8a38-dd13f89b400d" = {
    visibleName = "profile1";
    audibleBell = false;
    customCommand = "zsh";
    default = true;
  };
  themeVariant = "dark";
  showMenubar = false;
};

I discovered this by running dconf watch /org/gnome/terminal/legacy/profiles:/ and then manually creating a new profile named "MyProfile". I got the following output:

/org/gnome/terminal/legacy/profiles:/:04aa0881-b94f-47a3-8f83-83bda85750aa/visible-name
  'MyProfile'

If, in the configuration, I replace profile."060efe23-3ab4-4c71-8a38-dd13f89b400d" with profile.profile1, I get the following output from dconf:

/org/gnome/terminal/legacy/profiles:/:profile1/visible-name
  'profile1'

The profile only seems to be created when the <name> in /org/gnome/terminal/legacy/profiles:/:<name>/visible-name is a UUID.

A fix for this could be to document that <name> must be a UUID.

Alternatively, given that <name> in profile.<name>.<option> doesn't have any good use other than to be a UUID, the following could be done:

  1. the profile.<name>.visibleName option is removed;
  2. <name> in profile.<name>.<option> is used to set /org/gnome/terminal/legacy/profiles:/:<UUID>/visible-name;
  3. <name> in profile.<name>.<option> is passed to something akin to uuidgen --sha1 --namespace '@oid' --name profile.<name> to deterministically generate the UUID in /org/gnome/terminal/legacy/profiles:/:<UUID>/ for the profile.

Maintainer CC

@kamadorueda @rycee

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.25, NixOS, 23.05 (Stoat), 23.05.20230423.8f33856`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@MichaelMMacLeod MichaelMMacLeod added bug triage Issues or feature request that have not been triaged yet labels Apr 26, 2023
@ncfavier
Copy link
Member

In addition to documentation, we could enforce that with something like

uuid = mkOption {
  default = name;
  type = types.strMatching "<uuid regex>";
};

in the profileSubModule.

Also NixOS/nixpkgs#193311 could help with this.

I'm not sure about automatically generating the UUID, I think that would cause unnecessary breakage and also would require IFD, which we generally want to avoid.

@stale
Copy link

stale bot commented Jul 29, 2023

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

@stale stale bot added the status: stale label Jul 29, 2023
@rycee
Copy link
Member

rycee commented Jul 29, 2023

I think this got resolved in f58889c. Basically, the programs.gnome-terminal.profile option description now state that the name has to be an UUID. And there is an assertion verifying that they are UUIDs.

I'll close the issue, if you feel this is incorrect then feel free to comment and we'll reopen.

@rycee rycee closed this as completed Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: stale triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

5 participants