Skip to content

bug: vivid: home.sessionVariables and yaml vs scientific notation #7994

@arunoruto

Description

@arunoruto

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

This issue serves more as a discussion point for two things we have noticed in nix-community/stylix#1938

  1. @trueNAHO has noticed that we could use pkgs.runCommand and home.sessionVariables instead of configuring each shell by itself, meaning the config files of the shells won't be cluttered additionally and we don't need the vivid package in the environment. The only problem I have with this, is that the user (potentially?) needs to restart the system for a change to take effect. I am not sure how much of a problem that would be? We could introduce an additional option programs.vivid.enableSessionVariable and configure it through that too! Here is a POC which works on my system: vivid: init stylix#1938 (comment)
  2. The testbed in stylix had a particular hex code for a color, namely 1e2030. Since it is treated as a string by Nix and pkgs.remarshal's json2yaml, it is not written with single quotes. But by YAML standards, it is interpreted as a number in scientific notation, leading to vivid failing to load the theme correctly. This is kinda a niche edge case but not so easy to debug. A potential solution for this would be to save the contents as a JSON file, but keeping the .yml file ending. It is kinda weird, but it works.. Maybe an additional option like programs.vivid.saveAsJson could be provided for now (and maybe turn it on by default?). I haven't found any better solution for it now and I notified the dev via an issue, but by the looks of how often he responds, this will not be addressed/fixed in the foreseeable future. Meaning, we could exploit this "bug" and use JSON for now :)

Maintainer CC

@aguirre-matteo

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.12.50, NixOS, 25.05 (Warbler), 25.05.20251006.20c4598`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.28.5`
 - nixpkgs: `/nix/store/d7s7pkgp0shkac0qwf2f9w956fi6rh1i-source`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageIssues or feature request that have not been triaged yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions