nix-community / dconf2nix

:feet: Convert dconf files (e.g. GNOME Shell) to Nix, as expected by Home Manager [maintainer=@jtojnar]
Apache License 2.0
228 stars 6 forks source link

World clocks dconf returns not of type gvariant value #114

Closed StrangeGirlMurph closed 1 month ago

StrangeGirlMurph commented 1 month ago

Type of bug

Other (please add details in additional context)

Version

0.1.1

Did you test against master?

Error message (if not timeout)

dconf.settings."org/gnome/clocks".world-clocks."[definition 1-entry 1]"' is not of type `GVariant value'

DConf input

[org/gnome/clocks]
world-clocks=[{'location': <(uint32 2, <('New York', 'KNYC', true, [(0.71180344078725644, -1.2909618758762367)], [(0.71059804659265924, -1.2916478949920254)])>)>}]

[org/gnome/shell/world-clocks]
locations=[<(uint32 2, <('New York', 'KNYC', true, [(0.71180344078725644, -1.2909618758762367)], [(0.71059804659265924, -1.2916478949920254)])>)>]

Additional context

dconf2nix generates the following for the given dconf input:

    "org/gnome/clocks" = {
      world-clocks = [{
        location = mkVariant [ (mkUint32 2) (mkVariant [ "New York" "KNYC" true [ (mkTuple [ 0.7118034407872564 (-1.2909618758762367) ]) ] [ (mkTuple [ 0.7105980465926592 (-1.2916478949920254) ]) ] ]) ];
      }];
    };

    "org/gnome/shell/world-clocks" = {
      locations = [ (mkVariant [ (mkUint32 2) (mkVariant [ "New York" "KNYC" true [ (mkTuple [ 0.7118034407872564 (-1.2909618758762367) ]) ] [ (mkTuple [ 0.7105980465926592 (-1.2916478949920254) ]) ] ]) ]) ];
    };

When I try to use these with home-manager I get the mentioned error. I got it working (according to this) with this:

    "org/gnome/clocks" = {
      world-clocks = [
        ([
          (mkDictionaryEntry [
            "location"
            (mkVariant (mkTuple [
              (mkUint32 2)
              (mkVariant (mkTuple [
                "New York"
                "KNYC"
                true
                [ (mkTuple [ 0.71180344078725644 (-1.2909618758762367) ]) ]
                [ (mkTuple [ 0.71059804659265924 (-1.2916478949920254) ]) ]
              ]))
            ]))
          ])
        ])
      ];
    };

    "org/gnome/shell/world-clocks" = {
      locations = [
        (mkVariant (mkTuple [
          (mkUint32 2)
          (mkVariant (mkTuple [
            "New York"
            "KNYC"
            true
            [ (mkTuple [ 0.71180344078725644 (-1.2909618758762367) ]) ]
            [ (mkTuple [ 0.71059804659265924 (-1.2916478949920254) ]) ]
          ]))
        ]))
      ];
    };

I don't know which was the crucial change that made it work. I am still new to all this.

jtojnar commented 1 month ago

Thanks, that is actually fixed by https://github.com/nix-community/dconf2nix/commit/753db879fa49fd0ed5af928662f379a816c7c251 but I still have to finish some stuff before I can make a release.

StrangeGirlMurph commented 1 month ago

Oh great. Thank you :)