GithubHelp home page GithubHelp logo

nix-community / dconf2nix Goto Github PK

View Code? Open in Web Editor NEW
215.0 8.0 6.0 366 KB

:feet: Convert dconf files (e.g. GNOME Shell) to Nix, as expected by Home Manager [maintainer=@jtojnar]

License: Apache License 2.0

Haskell 45.47% Nix 54.53%
dconf nix home-manager gnome-shell nixos nixos-configuration gnome

dconf2nix's Introduction

dconf2nix

CI Status

A convenient converter of dconf files to Nix, as expected by Home Manager's dconf settings. So you can Nixify your GNOME Shell configuration πŸ˜‰


Benchmarks

Take it with a grain of salt but on my machine it takes an average of 7.1ms to process a 349 lines configuration and generate a Nix file with 433 lines.

benchmarks

Introduction

Given the following dconf settings:

[org/gnome/desktop/peripherals/mouse]
natural-scroll=false
speed=-0.5

[org/gnome/desktop/peripherals/touchpad]
tap-to-click=false
two-finger-scrolling-enabled=true

[org/gnome/desktop/input-sources]
current=uint32 0
sources=[('xkb', 'us')]
xkb-options=['terminate:ctrl_alt_bksp', 'lv3:ralt_switch', 'caps:ctrl_modifier']

[org/gnome/desktop/screensaver]
picture-uri='file:///home/gvolpe/Pictures/nixos.png'

You will get the following output when running dconf2nix:

{ lib, ... }:

with lib.hm.gvariant;
{
  dconf.settings = {
    "org/gnome/desktop/peripherals/mouse" = {
      natural-scroll = false;
      speed = -0.5;
    };

    "org/gnome/desktop/peripherals/touchpad" = {
      tap-to-click = false;
      two-finger-scrolling-enabled = true;
    };

    "org/gnome/desktop/input-sources" = {
      current = mkUint32 0;
      sources = [ (mkTuple [ "xkb" "us" ]) ];
      xkb-options = [ "terminate:ctrl_alt_bksp" "lv3:ralt_switch" "caps:ctrl_modifier" ];
    };

    "org/gnome/desktop/screensaver" = {
      picture-uri = "file:///home/gvolpe/Pictures/nixos.png";
    };
  };

}

It makes use of the Home Manager's dconf.settings key.

You can make changes in the UI and create a dump of your dconf file at any time, which you can Nixify so Home Manager can restore the next time you run home-manager switch. To create a dump, run the following command:

dconf dump / > dconf.settings

Run

The easiest way is to pipe the standard input to dconf2nix and expect the result in the standard output:

dconf dump / | dconf2nix > dconf.nix

If you have an input file instead, you can run the following command:

dconf2nix -i data/dconf.settings -o output/dconf.nix

Type --help for some more information.

dconf2nix - Nixify dconf configuration files

Usage: dconf2nix [-v|--version] [-r|--root ARG] [--verbose]
                 [(-i|--input ARG) (-o|--output ARG)]

  Convert a dconf file into a Nix file, as expected by Home Manager.

Available options:
  -h,--help                Show this help text
  -v,--version             Show the current version
  -r,--root ARG            Custom root path. e.g.: system/locale/
  --verbose                Verbose mode (debug)
  -i,--input ARG           Path to the dconf file (input)
  -o,--output ARG          Path to the Nix output file (to be created)

Custom root

By default, dconf2nix expects the root to be /. If you want to create a dump of a custom root, you can use the --root flag. For example:

dconf dump /system/locale/ | dconf2nix --root system/locale > dconf.nix

This will generate an output similar to the one below.

{
  dconf.settings = {
    "system/locale" = {
      region = "en_US.UTF-8";
    };

  };
}

Supported types

With some minor spots (e.g. hexadecimal floats), the complete GVariant text format is supported. But because Nix and GVariant data models are quite different, the Nix format can be a bit verbose, relying on constructor functions.

GNOME Shell configuration

Once you have your dconf.nix, you can import it via Home Manager.

{
  programs.home-manager.enable = true;

  imports = [
    ./dconf.nix
  ];
}

If you are using the Home Manager module for NixOS you can import it like so:

{
  home-manager.users.joe = { pkgs, ... }: {
    imports = [ ./dconf.nix ];
    # ...
  };
}

Installation

dconf2nix is available in Nixpkgs and can be installed as any other package. It can also be used without installing. For example, with flakes.

$ nix run nixpkgs#dconf2nix -- --version
<<< DCONF2NIX >>>
Version: 0.0.12
Maintainers: Nix Community
Source code: https://github.com/nix-commmunity/dconf2nix

To build it from source, it is recommend to use Cachix to reduce the compilation time.

Have a look at the latest releases for more information.

Troubleshooting

Do consider the caveats mentioned above in the Supported Types section.

Development

To compile and run the tests locally.

cabal new-configure
cabal new-run dconf2nix-tests

To generate the static binary.

cabal new-configure --disable-executable-dynamic --ghc-option=-optl=-static --ghc-option=-optl=-pthread
nix-build

If everything goes well, the binary should be under result/bin/.

dconf2nix's People

Contributors

ashleyyakeley avatar broccoli5 avatar gvolpe avatar jtojnar avatar maydayv7 avatar n-hebert avatar theotheroracle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dconf2nix's Issues

Stepping away, looking for maintainers

It's been a fun ride writing this toy project to satisfy two of my needs:

  1. Generate a dconf.nix expected by Home Manager.
  2. Play around with parser combinators in Haskell.

However, time has passed and I no longer have a need for this utility. Neither I have the time nor the willing to keep on working on it, but after seeing more issues and PRs being raised recently, I thought at least I'd post an update on the status of this project.

I will not contribute to this project anymore, but I would be happy to assign new maintainers.

Just leave a comment below if you're up for the task.

Error unexpected "%"

Type of bug

Parsing error

Version

0.0.11

Did you test against master?

  • Certainly

Error message (if not timeout)

dconf2nix: "<stdin>" (line 885, column 18):
unexpected "%"
expecting "'", letter or digit, space, "=", "$", "!", "&", "+", "-", "_", "(", ")", "[", "]", "{", "}", ",", "#", "@", "\\", ":", "/", ".", "<", ">" or new-line
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.0.11-FvzjRFPp3Hg72z35IWz5qX:DConf2Nix

DConf input

[org/gnome/rhythmbox/library]
layout-filename='%tN - %tt'
layout-path='%aa/%at'

Additional context

I can just reset the values and don't see any different behavior in the the application

dconf reset /org/gnome/rhythmbox/library/layout-filename
dconf reset /org/gnome/rhythmbox/library/layout-path

error: value is null while a set was expected

Type of bug

Parsing error

Version

Version: 0.0.12

Did you test against master?

  • Certainly

Error message (if not timeout)

error: value is null while a set was expected

       at /nix/store/wsbsx34vh2qckb4hvgqgpr2zsg0hn0g8-source/modules/lib/gvariant.nix:132:41:

          131|       gvarElems = map mkValue elems;
          132|       tupleType = type.tupleOf (map (e: e.type) gvarElems);
             |                                         ^
          133|     in mkPrimitive tupleType gvarElems // {
(use '--show-trace' to show detailed location information)
error: Recipe `rebuild` failed on line 82 with exit code 1

DConf input

[com/raggesilver/BlackBox]
cursor-blink-mode=uint32 1
easy-copy-paste=true
floating-controls=false
font='DroidSansM Nerd Font 20'
headerbar-drag-area=false
headerbar-draw-line-single-tab=false
show-headerbar=true
terminal-padding=(uint32 20, uint32 20, uint32 20, uint32 20)
theme-dark='base16: Twilight (dark)'
window-height=uint32 560
window-width=uint32 936

Additional context

results in:

"com/raggesilver/BlackBox" = {
      cursor-blink-mode = mkUint32 1;
      easy-copy-paste = true;
      floating-controls = false;
      font = "DroidSansM Nerd Font 20";
      headerbar-drag-area = false;
      headerbar-draw-line-single-tab = false;
      show-headerbar = true;
      terminal-padding = mkTuple [ mkUint32 20 mkUint32 20 ];

The line that is causing the issue is the terminal-padding = mkTuple [ mkUint32 20 mkUint32 20 ];. If I remove that from the dconf.nix that was generated, I can run a rebuild without issue.

Timeout when dconf.settings has ('xkb', 'us+alt-intl') [org/gnome/desktop/input-sources]

[org/gnome/desktop/input-sources]
current='uint32 0'
sources=[('xkb', 'us+alt-intl')]
xkb-options=['terminate:ctrl_alt_bksp', 'lv3:ralt_switch']

The above addition to my dconf.settings file makes dconf2nix time out when trying to parse into a .nix file. It also times out when there is a list of multiple sources and 'us+alt-intl' is one of them, but not when it is a list of sources like 'us' and 'fr'. Curious if it is because of the '+' and '-' in the keyboard name.

Edit 1: But looking at Dconf.hs on line 66 it seems to allow for these characters in Strings.
Edit 2: It seems the commit that allows '+' in Strings came after the last release. I will try using the master branch.

Fail to parse list of strings containing JSON values

[org/gnome/shell/extensions/list-of-json-str]
devices=['{"_model":{},"name":"FakeName","isConnected":false,"isPaired":true,"mac":"00:16:00:29:00:83","isDefault":false,"active":true,"icon":"audio-headphones-symbolic"}']

Fails if header contains `_`

Buit from master(a7ce581)

Input:

[org/gnome/shell/extensions/bluetooth_battery_indicator]
devices=['{"_model":{},"name":"FakeName","isConnected":false,"isPaired":true,"mac":"00:16:00:29:00:83","isDefault":false,"active":true,"icon":"audio-headphones-symbolic"}']
hide-indicator=true

Error:

dconf2nix: "<stdin>" (line 1, column 38):
unexpected "_"
expecting letter or digit, " ]" or "]"
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.0.11-5IC5PdwirMmE518swqY2Y3:DConf2Nix

Trouble with JSON-like entries

I have the following settings for my GNOME extension sound-output-device-chooser

[org/gnome/shell/extensions/sound-output-device-chooser]
hide-on-single-device=true
ports-settings='{"version":2,"ports":[]}'

which dcont2nix converts to this:

"org/gnome/shell/extensions/sound-output-device-chooser" = {
  hide-on-single-device = true;
  ports-settings = "'{"version":2,"ports":[]}'";
};

However, when I try to apply a switch in my Home-Manager config, it returns the following error:

error: undefined variable 'version'

Emoji causes `timeout`

Type of bug

Timeout

Version

0.0.11

Did you test against master?

  • Certainly

Error message (if not timeout)

No response

DConf input

[org/gnome/Characters]
recent-characters=['πŸ’‘']

Additional context

dcon2nix --verbose shows how the Emoji is converted:

dconf: "[org/gnome/Characters]\nrecent-characters=['\128161']\n"

Hangs when parsing `!` in a list of strings

Using dconf2nix v0.0.10.

[org/gnome/shell/extensions/arcmenu]
hot-corners='Disabled'
recently-installed-apps=['RollerCoaster Tycoon 3 Platinum!.desktop', 'RollerCoaster Tycoon Deluxe.desktop', 'RollerCoaster Tycoon 2 Triple Thrill Pack.desktop', 'American Truck Simulator.desktop', 'Halo The Master Chief Collection.desktop', 'Bejeweled 3.desktop']

The ! in the first entry of the list Platinum!.desktop makes dconf2nix hang.

Parse error on colon in top-level

πŸ‘‹ When parsing a straight dump, I get:

dconf2nix: "dconf.settings" (line 169, column 36):
unexpected ":"
expecting letter or digit, " ]", "]", "/" or "-"
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:14:18 in dconf2nix-0.0.2-HyzAD6ImgAPIFbugMY0Kb7:DConf2Nix

Which corresponds to the first ':' in this line:

[org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9]

error importing dconf.nix

Type of bug

Other (please add details in additional context)

Version

0.1.1

Did you test against master?

  • Certainly

Error message (if not timeout)

home-manager switch
error:
       … while evaluating a branch condition

         at /nix/store/599wy5snf00pn1apmsnzmiy0ysdpds03-source/lib/lists.nix:57:9:

           56|       fold' = n:
           57|         if n == len
             |         ^
           58|         then nul

       … while calling the 'length' builtin

         at /nix/store/599wy5snf00pn1apmsnzmiy0ysdpds03-source/lib/lists.nix:55:13:

           54|     let
           55|       len = length list;
             |             ^
           56|       fold' = n:

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: getting status of '/nix/store/763p5lx791b5cggvsk1djpnbv81x82dx-source/dconf.nix': No such file or directory

[shmuel@nixos:~]$ home-manager switch
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/599wy5snf00pn1apmsnzmiy0ysdpds03-source/pkgs/stdenv/generic/make-derivation.nix:353:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/599wy5snf00pn1apmsnzmiy0ysdpds03-source/pkgs/build-support/trivial-builders/default.nix:98:16:

           97|         enableParallelBuilding = true;
           98|         inherit buildCommand name;
             |                ^
           99|         passAsFile = [ "buildCommand" ]

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: A definition for option `dconf.settings."org/gnome/shell/extensions/dash-to-panel".animate-appicon-hover-animation-extent' is not of type `GVariant value'. Definition values:
       - In `/nix/store/4xd21wmi2lrpkf17dfxr351yfnj7iknh-source/dconf.nix':
           {
             PLANK = 4;
             RIPPLE = 4;
             SIMPLE = 1;
           }

DConf input

[com/mattjakeman/ExtensionManager]
last-used-version='0.4.2'

[org/gnome/Console]
font-scale=0.99999999999999989
last-window-size=(758, 561)

[org/gnome/TextEditor]
restore-session=false

[org/gnome/baobab/ui]
is-maximized=false
window-size=(960, 600)

[org/gnome/calendar]
active-view='month'
window-maximized=true
window-size=(768, 600)

[org/gnome/control-center]
last-panel='bluetooth'
window-state=(980, 640, false)

[org/gnome/deja-dup]
backend='local'
delete-after=0
exclude-list=['$TRASH', '$DOWNLOAD', '/home/shmuel/.goldendict', '/home/shmuel/.config/google-chrome/Default/Service Worker']
last-backup='2024-02-12T07:48:23.115399Z'
last-restore='2024-02-12T08:59:15.215266Z'
last-run='2024-02-12T07:48:11.859337Z'
nag-check='2024-02-09T06:21:10.153395Z'
periodic-period=7
prompt-check='2024-02-09T07:17:30.426952Z'
tool='duplicity'
window-height=500
window-width=700

[org/gnome/deja-dup/local]
folder='/run/media/shmuel/VM/Deja-dup'

[org/gnome/desktop/app-folders]
folder-children=['Utilities', 'YaST', 'Pardus']

[org/gnome/desktop/app-folders/folders/Pardus]
categories=['X-Pardus-Apps']
name='X-Pardus-Apps.directory'
translate=true

[org/gnome/desktop/app-folders/folders/Utilities]
apps=['gnome-abrt.desktop', 'gnome-system-log.desktop', 'nm-connection-editor.desktop', 'org.gnome.baobab.desktop', 'org.gnome.Connections.desktop', 'org.gnome.DejaDup.desktop', 'org.gnome.Dictionary.desktop', 'org.gnome.DiskUtility.desktop', 'org.gnome.Evince.desktop', 'org.gnome.FileRoller.desktop', 'org.gnome.fonts.desktop', 'org.gnome.Loupe.desktop', 'org.gnome.seahorse.Application.desktop', 'org.gnome.tweaks.desktop', 'org.gnome.Usage.desktop', 'vinagre.desktop']
categories=['X-GNOME-Utilities']
name='X-GNOME-Utilities.directory'
translate=true

[org/gnome/desktop/app-folders/folders/YaST]
categories=['X-SuSE-YaST']
name='suse-yast.directory'
translate=true

[org/gnome/desktop/input-sources]
mru-sources=[('xkb', 'us')]
sources=[('xkb', 'us'), ('xkb', 'il')]
xkb-options=['terminate:ctrl_alt_bksp', 'grp:win_space_toggle']

[org/gnome/desktop/interface]
clock-format='12h'
clock-show-weekday=true
color-scheme='default'
font-antialiasing='grayscale'
font-hinting='slight'
icon-theme='Papirus'
toolkit-accessibility=false

[org/gnome/desktop/notifications]
application-children=['org-gnome-console', 'google-chrome', 'gnome-power-panel', 'chrome-chpiljhfemlfpnfoohpbokdofonkiifm-default', 'org-gnome-gedit', 'org-gnome-dejadup', 'timeshift-gtk', 'org-gnome-software', 'gnome-printers-panel', 'chrome-nlliaccamikgfncmkebcmomodchimcbo-default']

[org/gnome/desktop/notifications/application/chrome-chpiljhfemlfpnfoohpbokdofonkiifm-default]
application-id='chrome-chpiljhfemlfpnfoohpbokdofonkiifm-Default.desktop'

[org/gnome/desktop/notifications/application/chrome-nlliaccamikgfncmkebcmomodchimcbo-default]
application-id='chrome-nlliaccamikgfncmkebcmomodchimcbo-Default.desktop'

[org/gnome/desktop/notifications/application/gnome-power-panel]
application-id='gnome-power-panel.desktop'

[org/gnome/desktop/notifications/application/gnome-printers-panel]
application-id='gnome-printers-panel.desktop'

[org/gnome/desktop/notifications/application/google-chrome]
application-id='google-chrome.desktop'

[org/gnome/desktop/notifications/application/org-gnome-console]
application-id='org.gnome.Console.desktop'

[org/gnome/desktop/notifications/application/org-gnome-dejadup]
application-id='org.gnome.DejaDup.desktop'

[org/gnome/desktop/notifications/application/org-gnome-gedit]
application-id='org.gnome.gedit.desktop'

[org/gnome/desktop/notifications/application/org-gnome-software]
application-id='org.gnome.Software.desktop'

[org/gnome/desktop/notifications/application/timeshift-gtk]
application-id='timeshift-gtk.desktop'

[org/gnome/desktop/session]
idle-delay=uint32 600

[org/gnome/desktop/wm/preferences]
button-layout='appmenu:minimize,maximize,close'

[org/gnome/epiphany]
ask-for-default=false

[org/gnome/evince]
document-directory=@ms 'file:///run/media/shmuel/PersonalData/DBS%20Tzuras%20Hadaf/%D7%AA%D7%9C%D7%9E%D7%95%D7%93%20%D7%91%D7%91%D7%9C%D7%99/%D7%A9%D7%A1%20%D7%A0%D7%94%D7%A8%D7%93%D7%A2%D7%90'

[org/gnome/evince/default]
continuous=true
dual-page=false
dual-page-odd-left=false
enable-spellchecking=true
fullscreen=false
inverted-colors=false
show-sidebar=false
sidebar-page='thumbnails'
sidebar-size=132
sizing-mode='automatic'
window-ratio=(0.44794050343249425, 0.20430544272948822)

[org/gnome/evolution-data-server]
migrated=true

[org/gnome/gedit/plugins/filebrowser]
root='file:///'
tree-view=true
virtual-root='file:///home/shmuel'

[org/gnome/gedit/preferences/print]
print-font-body-pango='Monospace 9'
print-font-header-pango='Sans 11'
print-font-numbers-pango='Sans 8'
print-header=true
print-line-numbers=uint32 0
print-syntax-highlighting=true
print-wrap-mode='word'

[org/gnome/gedit/state/window]
bottom-panel-size=140
side-panel-active-page='GeditWindowDocumentsPanel'
side-panel-size=200
size=(900, 700)
state=87168

[org/gnome/gnome-system-monitor]
maximized=false
network-total-in-bits=false
show-dependencies=false
show-whose-processes='user'
window-state=(1079, 500, 26, 23)

[org/gnome/gnome-system-monitor/disktreenew]
col-6-visible=true
col-6-width=0

[org/gnome/gnome-system-monitor/proctree]
columns-order=[0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
sort-col=8
sort-order=0

[org/gnome/mutter]
overlay-key='Super_L'

[org/gnome/nautilus/preferences]
default-folder-viewer='icon-view'
migrated-gtk-settings=true
search-filter-time-type='last_modified'

[org/gnome/nautilus/window-state]
initial-size=(890, 550)

[org/gnome/portal/filechooser/google-chrome]
last-folder-path='/home/shmuel/Downloads'

[org/gnome/settings-daemon/plugins/power]
sleep-inactive-ac-type='nothing'

[org/gnome/shell]
disable-user-extensions=false
disabled-extensions=['[email protected]', '[email protected]']
enabled-extensions=['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
favorite-apps=['org.gnome.gedit.desktop', 'org.gnome.Console.desktop', 'gnome-system-monitor.desktop', 'org.gnome.Nautilus.desktop']
last-selected-power-profile='performance'
welcome-dialog-last-shown-version='45.3'

[org/gnome/shell/extensions/arcmenu]
custom-menu-button-icon='/home/shmuel/nixos.svg'
menu-background-color='rgba(48,48,49,0.98)'
menu-border-color='rgb(60,60,60)'
menu-button-appearance='Icon'
menu-button-icon='Custom_Icon'
menu-foreground-color='rgb(223,223,223)'
menu-item-active-bg-color='rgb(25,98,163)'
menu-item-active-fg-color='rgb(255,255,255)'
menu-item-hover-bg-color='rgb(21,83,158)'
menu-item-hover-fg-color='rgb(255,255,255)'
menu-separator-color='rgba(255,255,255,0.1)'
pinned-app-list=['conky', '', 'conky.desktop', 'Oracle VM VirtualBox', '', 'virtualbox.desktop', 'Google Chrome', '', 'google-chrome.desktop', 'Toggl Track', '', 'com.toggl.TogglDesktop.desktop', 'To Do', '', 'chrome-nlliaccamikgfncmkebcmomodchimcbo-Default.desktop', 'GoldenDict-ng', '', 'io.github.xiaoyifang.goldendict_ng.desktop', 'Audacious', '', 'audacious.desktop', 'Extension Manager', '', 'com.mattjakeman.ExtensionManager.desktop', 'LosslessCut', '', 'losslesscut.desktop', 'Drawing', '', 'com.github.maoschanz.drawing.desktop', 'Backups', '', 'org.gnome.DejaDup.desktop', 'Media Downloader', '', 'media-downloader.desktop']
prefs-visible-page=0
recently-installed-apps=['vlc.desktop', 'mplayer.desktop', 'calc.desktop', 'math.desktop', 'draw.desktop', 'startcenter.desktop', 'base.desktop', 'org.gnome.Software.desktop', 'audacity.desktop']
search-entry-border-radius=(true, 25)

[org/gnome/shell/extensions/clipboard-indicator]
history-size=50
move-item-first=true
strip-text=true

[org/gnome/shell/extensions/dash-to-panel]
animate-appicon-hover-animation-extent={'RIPPLE': 4, 'PLANK': 4, 'SIMPLE': 1}
app-ctrl-hotkey-1=['<Control><Super>1']
app-ctrl-hotkey-10=['<Control><Super>0']
app-ctrl-hotkey-2=['<Control><Super>2']
app-ctrl-hotkey-3=['<Control><Super>3']
app-ctrl-hotkey-4=['<Control><Super>4']
app-ctrl-hotkey-5=['<Control><Super>5']
app-ctrl-hotkey-6=['<Control><Super>6']
app-ctrl-hotkey-7=['<Control><Super>7']
app-ctrl-hotkey-8=['<Control><Super>8']
app-ctrl-hotkey-9=['<Control><Super>9']
app-ctrl-hotkey-kp-1=['<Control><Super>KP_1']
app-ctrl-hotkey-kp-10=['<Control><Super>KP_0']
app-ctrl-hotkey-kp-2=['<Control><Super>KP_2']
app-ctrl-hotkey-kp-3=['<Control><Super>KP_3']
app-ctrl-hotkey-kp-4=['<Control><Super>KP_4']
app-ctrl-hotkey-kp-5=['<Control><Super>KP_5']
app-ctrl-hotkey-kp-6=['<Control><Super>KP_6']
app-ctrl-hotkey-kp-7=['<Control><Super>KP_7']
app-ctrl-hotkey-kp-8=['<Control><Super>KP_8']
app-ctrl-hotkey-kp-9=['<Control><Super>KP_9']
app-hotkey-1=['<Super>1']
app-hotkey-10=['<Super>0']
app-hotkey-2=['<Super>2']
app-hotkey-3=['<Super>3']
app-hotkey-4=['<Super>4']
app-hotkey-5=['<Super>5']
app-hotkey-6=['<Super>6']
app-hotkey-7=['<Super>7']
app-hotkey-8=['<Super>8']
app-hotkey-9=['<Super>9']
app-hotkey-kp-1=['<Super>KP_1']
app-hotkey-kp-10=['<Super>KP_0']
app-hotkey-kp-2=['<Super>KP_2']
app-hotkey-kp-3=['<Super>KP_3']
app-hotkey-kp-4=['<Super>KP_4']
app-hotkey-kp-5=['<Super>KP_5']
app-hotkey-kp-6=['<Super>KP_6']
app-hotkey-kp-7=['<Super>KP_7']
app-hotkey-kp-8=['<Super>KP_8']
app-hotkey-kp-9=['<Super>KP_9']
app-shift-hotkey-1=['<Shift><Super>1']
app-shift-hotkey-10=['<Shift><Super>0']
app-shift-hotkey-2=['<Shift><Super>2']
app-shift-hotkey-3=['<Shift><Super>3']
app-shift-hotkey-4=['<Shift><Super>4']
app-shift-hotkey-5=['<Shift><Super>5']
app-shift-hotkey-6=['<Shift><Super>6']
app-shift-hotkey-7=['<Shift><Super>7']
app-shift-hotkey-8=['<Shift><Super>8']
app-shift-hotkey-9=['<Shift><Super>9']
app-shift-hotkey-kp-1=['<Shift><Super>KP_1']
app-shift-hotkey-kp-10=['<Shift><Super>KP_0']
app-shift-hotkey-kp-2=['<Shift><Super>KP_2']
app-shift-hotkey-kp-3=['<Shift><Super>KP_3']
app-shift-hotkey-kp-4=['<Shift><Super>KP_4']
app-shift-hotkey-kp-5=['<Shift><Super>KP_5']
app-shift-hotkey-kp-6=['<Shift><Super>KP_6']
app-shift-hotkey-kp-7=['<Shift><Super>KP_7']
app-shift-hotkey-kp-8=['<Shift><Super>KP_8']
app-shift-hotkey-kp-9=['<Shift><Super>KP_9']
appicon-margin=8
appicon-padding=4
available-monitors=[0, 1]
dot-position='BOTTOM'
group-apps=false
hotkeys-overlay-combo='TEMPORARILY'
isolate-monitors=true
leftbox-padding=-1
panel-anchors='{"0":"MIDDLE","1":"MIDDLE"}'
panel-lengths='{"0":100,"1":100}'
panel-sizes='{"0":36,"1":36}'
primary-monitor=0
status-icon-padding=-1
tray-padding=-1
window-preview-title-position='TOP'

[org/gnome/shell/extensions/mediacontrols]
mouse-actions=['toggle_play', 'toggle_menu', 'none', 'none', 'none', 'none', 'none', 'none']
show-control-icons-next=false
show-control-icons-previous=false
show-control-icons-seek-backward=false
show-control-icons-seek-forward=false
show-label=false
show-next-icon=false
show-player-icon=false
show-prev-icon=false
show-seek-back=false
show-seek-forward=false
show-seperators=false
show-sources-menu=false
show-text=false

[org/gnome/shell/world-clocks]
locations=@av []

[org/gnome/software]
check-timestamp=int64 1707710496
first-run=false
flatpak-purge-timestamp=int64 1707696029

[org/gnome/tweaks]
show-extensions-notice=false

[org/gtk/gtk4/settings/file-chooser]
date-format='regular'
location-mode='path-bar'
show-hidden=true
show-size-column=true
show-type-column=true
sidebar-width=140
sort-column='name'
sort-directories-first=true
sort-order='ascending'
type-format='category'
view-type='list'
window-size=(859, 372)

[org/gtk/settings/file-chooser]
clock-format='12h'
date-format='regular'
location-mode='path-bar'
show-hidden=false
show-size-column=true
show-type-column=true
sidebar-width=157
sort-column='name'
sort-directories-first=false
sort-order='ascending'
type-format='category'
window-position=(26, 23)
window-size=(1203, 902)

Additional context

I did not test against master because AFAIK this is the latest version.
I am running home-manager as standalone on NixOS unstable.
The initial conversion from dconf.settings to dconf.nix is without error.
The problem is when rebuilding home manager.
This is the contents of dconf.nix

# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix
{ lib, ... }:

with lib.hm.gvariant;

{
  dconf.settings = {
    "com/mattjakeman/ExtensionManager" = {
      last-used-version = "0.4.2";
    };

    "org/gnome/Console" = {
      font-scale = 0.9999999999999999;
      last-window-size = mkTuple [ 758 561 ];
    };

    "org/gnome/TextEditor" = {
      restore-session = false;
    };

    "org/gnome/baobab/ui" = {
      is-maximized = false;
      window-size = mkTuple [ 960 600 ];
    };

    "org/gnome/calendar" = {
      active-view = "month";
      window-maximized = true;
      window-size = mkTuple [ 768 600 ];
    };

    "org/gnome/control-center" = {
      last-panel = "bluetooth";
      window-state = mkTuple [ 980 640 false ];
    };

    "org/gnome/deja-dup" = {
      backend = "local";
      delete-after = 0;
      exclude-list = [ "$TRASH" "$DOWNLOAD" "/home/shmuel/.goldendict" "/home/shmuel/.config/google-chrome/Default/Service Worker" ];
      last-backup = "2024-02-12T07:48:23.115399Z";
      last-restore = "2024-02-12T08:59:15.215266Z";
      last-run = "2024-02-12T07:48:11.859337Z";
      nag-check = "2024-02-09T06:21:10.153395Z";
      periodic-period = 7;
      prompt-check = "2024-02-09T07:17:30.426952Z";
      tool = "duplicity";
      window-height = 500;
      window-width = 700;
    };

    "org/gnome/deja-dup/local" = {
      folder = "/run/media/shmuel/VM/Deja-dup";
    };

    "org/gnome/desktop/app-folders" = {
      folder-children = [ "Utilities" "YaST" "Pardus" ];
    };

    "org/gnome/desktop/app-folders/folders/Pardus" = {
      categories = [ "X-Pardus-Apps" ];
      name = "X-Pardus-Apps.directory";
      translate = true;
    };

    "org/gnome/desktop/app-folders/folders/Utilities" = {
      apps = [ "gnome-abrt.desktop" "gnome-system-log.desktop" "nm-connection-editor.desktop" "org.gnome.baobab.desktop" "org.gnome.Connections.desktop" "org.gnome.DejaDup.desktop" "org.gnome.Dictionary.desktop" "org.gnome.DiskUtility.desktop" "org.gnome.Evince.desktop" "org.gnome.FileRoller.desktop" "org.gnome.fonts.desktop" "org.gnome.Loupe.desktop" "org.gnome.seahorse.Application.desktop" "org.gnome.tweaks.desktop" "org.gnome.Usage.desktop" "vinagre.desktop" ];
      categories = [ "X-GNOME-Utilities" ];
      name = "X-GNOME-Utilities.directory";
      translate = true;
    };

    "org/gnome/desktop/app-folders/folders/YaST" = {
      categories = [ "X-SuSE-YaST" ];
      name = "suse-yast.directory";
      translate = true;
    };

    "org/gnome/desktop/input-sources" = {
      mru-sources = [ (mkTuple [ "xkb" "us" ]) ];
      sources = [ (mkTuple [ "xkb" "us" ]) (mkTuple [ "xkb" "il" ]) ];
      xkb-options = [ "terminate:ctrl_alt_bksp" "grp:win_space_toggle" ];
    };

    "org/gnome/desktop/interface" = {
      clock-format = "12h";
      clock-show-weekday = true;
      color-scheme = "default";
      font-antialiasing = "grayscale";
      font-hinting = "slight";
      icon-theme = "Papirus";
      toolkit-accessibility = false;
    };

    "org/gnome/desktop/notifications" = {
      application-children = [ "org-gnome-console" "google-chrome" "gnome-power-panel" "chrome-chpiljhfemlfpnfoohpbokdofonkiifm-default" "org-gnome-gedit" "org-gnome-dejadup" "timeshift-gtk" "org-gnome-software" "gnome-printers-panel" "chrome-nlliaccamikgfncmkebcmomodchimcbo-default" ];
    };

    "org/gnome/desktop/notifications/application/chrome-chpiljhfemlfpnfoohpbokdofonkiifm-default" = {
      application-id = "chrome-chpiljhfemlfpnfoohpbokdofonkiifm-Default.desktop";
    };

    "org/gnome/desktop/notifications/application/chrome-nlliaccamikgfncmkebcmomodchimcbo-default" = {
      application-id = "chrome-nlliaccamikgfncmkebcmomodchimcbo-Default.desktop";
    };

    "org/gnome/desktop/notifications/application/gnome-power-panel" = {
      application-id = "gnome-power-panel.desktop";
    };

    "org/gnome/desktop/notifications/application/gnome-printers-panel" = {
      application-id = "gnome-printers-panel.desktop";
    };

    "org/gnome/desktop/notifications/application/google-chrome" = {
      application-id = "google-chrome.desktop";
    };

    "org/gnome/desktop/notifications/application/org-gnome-console" = {
      application-id = "org.gnome.Console.desktop";
    };

    "org/gnome/desktop/notifications/application/org-gnome-dejadup" = {
      application-id = "org.gnome.DejaDup.desktop";
    };

    "org/gnome/desktop/notifications/application/org-gnome-gedit" = {
      application-id = "org.gnome.gedit.desktop";
    };

    "org/gnome/desktop/notifications/application/org-gnome-software" = {
      application-id = "org.gnome.Software.desktop";
    };

    "org/gnome/desktop/notifications/application/timeshift-gtk" = {
      application-id = "timeshift-gtk.desktop";
    };

    "org/gnome/desktop/session" = {
      idle-delay = mkUint32 600;
    };

    "org/gnome/desktop/wm/preferences" = {
      button-layout = "appmenu:minimize,maximize,close";
    };

    "org/gnome/epiphany" = {
      ask-for-default = false;
    };

    "org/gnome/evince" = {
      document-directory = "file:///run/media/shmuel/PersonalData/DBS%20Tzuras%20Hadaf/%D7%AA%D7%9C%D7%9E%D7%95%D7%93%20%D7%91%D7%91%D7%9C%D7%99/%D7%A9%D7%A1%20%D7%A0%D7%94%D7%A8%D7%93%D7%A2%D7%90";
    };

    "org/gnome/evince/default" = {
      continuous = true;
      dual-page = false;
      dual-page-odd-left = false;
      enable-spellchecking = true;
      fullscreen = false;
      inverted-colors = false;
      show-sidebar = false;
      sidebar-page = "thumbnails";
      sidebar-size = 132;
      sizing-mode = "automatic";
      window-ratio = mkTuple [ 0.44794050343249425 0.20430544272948822 ];
    };

    "org/gnome/evolution-data-server" = {
      migrated = true;
    };

    "org/gnome/gedit/plugins/filebrowser" = {
      root = "file:///";
      tree-view = true;
      virtual-root = "file:///home/shmuel";
    };

    "org/gnome/gedit/preferences/print" = {
      print-font-body-pango = "Monospace 9";
      print-font-header-pango = "Sans 11";
      print-font-numbers-pango = "Sans 8";
      print-header = true;
      print-line-numbers = mkUint32 0;
      print-syntax-highlighting = true;
      print-wrap-mode = "word";
    };

    "org/gnome/gedit/state/window" = {
      bottom-panel-size = 140;
      side-panel-active-page = "GeditWindowDocumentsPanel";
      side-panel-size = 200;
      size = mkTuple [ 900 700 ];
      state = 87168;
    };

    "org/gnome/gnome-system-monitor" = {
      maximized = false;
      network-total-in-bits = false;
      show-dependencies = false;
      show-whose-processes = "user";
      window-state = mkTuple [ 1079 500 26 23 ];
    };

    "org/gnome/gnome-system-monitor/disktreenew" = {
      col-6-visible = true;
      col-6-width = 0;
    };

    "org/gnome/gnome-system-monitor/proctree" = {
      columns-order = [ 0 1 2 3 4 6 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ];
      sort-col = 8;
      sort-order = 0;
    };

    "org/gnome/mutter" = {
      overlay-key = "Super_L";
    };

    "org/gnome/nautilus/preferences" = {
      default-folder-viewer = "icon-view";
      migrated-gtk-settings = true;
      search-filter-time-type = "last_modified";
    };

    "org/gnome/nautilus/window-state" = {
      initial-size = mkTuple [ 890 550 ];
    };

    "org/gnome/portal/filechooser/google-chrome" = {
      last-folder-path = "/home/shmuel/Downloads";
    };

    "org/gnome/settings-daemon/plugins/power" = {
      sleep-inactive-ac-type = "nothing";
    };

    "org/gnome/shell" = {
      disable-user-extensions = false;
      disabled-extensions = [ "[email protected]" "[email protected]" ];
      enabled-extensions = [ "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" ];
      favorite-apps = [ "org.gnome.gedit.desktop" "org.gnome.Console.desktop" "gnome-system-monitor.desktop" "org.gnome.Nautilus.desktop" ];
      last-selected-power-profile = "performance";
      welcome-dialog-last-shown-version = "45.3";
    };

    "org/gnome/shell/extensions/arcmenu" = {
      custom-menu-button-icon = "/home/shmuel/nixos.svg";
      menu-background-color = "rgba(48,48,49,0.98)";
      menu-border-color = "rgb(60,60,60)";
      menu-button-appearance = "Icon";
      menu-button-icon = "Custom_Icon";
      menu-foreground-color = "rgb(223,223,223)";
      menu-item-active-bg-color = "rgb(25,98,163)";
      menu-item-active-fg-color = "rgb(255,255,255)";
      menu-item-hover-bg-color = "rgb(21,83,158)";
      menu-item-hover-fg-color = "rgb(255,255,255)";
      menu-separator-color = "rgba(255,255,255,0.1)";
      pinned-app-list = [ "conky" "" "conky.desktop" "Oracle VM VirtualBox" "" "virtualbox.desktop" "Google Chrome" "" "google-chrome.desktop" "Toggl Track" "" "com.toggl.TogglDesktop.desktop" "To Do" "" "chrome-nlliaccamikgfncmkebcmomodchimcbo-Default.desktop" "GoldenDict-ng" "" "io.github.xiaoyifang.goldendict_ng.desktop" "Audacious" "" "audacious.desktop" "Extension Manager" "" "com.mattjakeman.ExtensionManager.desktop" "LosslessCut" "" "losslesscut.desktop" "Drawing" "" "com.github.maoschanz.drawing.desktop" "Backups" "" "org.gnome.DejaDup.desktop" "Media Downloader" "" "media-downloader.desktop" ];
      prefs-visible-page = 0;
      recently-installed-apps = [ "vlc.desktop" "mplayer.desktop" "calc.desktop" "math.desktop" "draw.desktop" "startcenter.desktop" "base.desktop" "org.gnome.Software.desktop" "audacity.desktop" ];
      search-entry-border-radius = mkTuple [ true 25 ];
    };

    "org/gnome/shell/extensions/clipboard-indicator" = {
      history-size = 50;
      move-item-first = true;
      strip-text = true;
    };

    "org/gnome/shell/extensions/dash-to-panel" = {
      animate-appicon-hover-animation-extent = {
        RIPPLE = 4;
        PLANK = 4;
        SIMPLE = 1;
      };
      app-ctrl-hotkey-1 = [ "<Control><Super>1" ];
      app-ctrl-hotkey-10 = [ "<Control><Super>0" ];
      app-ctrl-hotkey-2 = [ "<Control><Super>2" ];
      app-ctrl-hotkey-3 = [ "<Control><Super>3" ];
      app-ctrl-hotkey-4 = [ "<Control><Super>4" ];
      app-ctrl-hotkey-5 = [ "<Control><Super>5" ];
      app-ctrl-hotkey-6 = [ "<Control><Super>6" ];
      app-ctrl-hotkey-7 = [ "<Control><Super>7" ];
      app-ctrl-hotkey-8 = [ "<Control><Super>8" ];
      app-ctrl-hotkey-9 = [ "<Control><Super>9" ];
      app-ctrl-hotkey-kp-1 = [ "<Control><Super>KP_1" ];
      app-ctrl-hotkey-kp-10 = [ "<Control><Super>KP_0" ];
      app-ctrl-hotkey-kp-2 = [ "<Control><Super>KP_2" ];
      app-ctrl-hotkey-kp-3 = [ "<Control><Super>KP_3" ];
      app-ctrl-hotkey-kp-4 = [ "<Control><Super>KP_4" ];
      app-ctrl-hotkey-kp-5 = [ "<Control><Super>KP_5" ];
      app-ctrl-hotkey-kp-6 = [ "<Control><Super>KP_6" ];
      app-ctrl-hotkey-kp-7 = [ "<Control><Super>KP_7" ];
      app-ctrl-hotkey-kp-8 = [ "<Control><Super>KP_8" ];
      app-ctrl-hotkey-kp-9 = [ "<Control><Super>KP_9" ];
      app-hotkey-1 = [ "<Super>1" ];
      app-hotkey-10 = [ "<Super>0" ];
      app-hotkey-2 = [ "<Super>2" ];
      app-hotkey-3 = [ "<Super>3" ];
      app-hotkey-4 = [ "<Super>4" ];
      app-hotkey-5 = [ "<Super>5" ];
      app-hotkey-6 = [ "<Super>6" ];
      app-hotkey-7 = [ "<Super>7" ];
      app-hotkey-8 = [ "<Super>8" ];
      app-hotkey-9 = [ "<Super>9" ];
      app-hotkey-kp-1 = [ "<Super>KP_1" ];
      app-hotkey-kp-10 = [ "<Super>KP_0" ];
      app-hotkey-kp-2 = [ "<Super>KP_2" ];
      app-hotkey-kp-3 = [ "<Super>KP_3" ];
      app-hotkey-kp-4 = [ "<Super>KP_4" ];
      app-hotkey-kp-5 = [ "<Super>KP_5" ];
      app-hotkey-kp-6 = [ "<Super>KP_6" ];
      app-hotkey-kp-7 = [ "<Super>KP_7" ];
      app-hotkey-kp-8 = [ "<Super>KP_8" ];
      app-hotkey-kp-9 = [ "<Super>KP_9" ];
      app-shift-hotkey-1 = [ "<Shift><Super>1" ];
      app-shift-hotkey-10 = [ "<Shift><Super>0" ];
      app-shift-hotkey-2 = [ "<Shift><Super>2" ];
      app-shift-hotkey-3 = [ "<Shift><Super>3" ];
      app-shift-hotkey-4 = [ "<Shift><Super>4" ];
      app-shift-hotkey-5 = [ "<Shift><Super>5" ];
      app-shift-hotkey-6 = [ "<Shift><Super>6" ];
      app-shift-hotkey-7 = [ "<Shift><Super>7" ];
      app-shift-hotkey-8 = [ "<Shift><Super>8" ];
      app-shift-hotkey-9 = [ "<Shift><Super>9" ];
      app-shift-hotkey-kp-1 = [ "<Shift><Super>KP_1" ];
      app-shift-hotkey-kp-10 = [ "<Shift><Super>KP_0" ];
      app-shift-hotkey-kp-2 = [ "<Shift><Super>KP_2" ];
      app-shift-hotkey-kp-3 = [ "<Shift><Super>KP_3" ];
      app-shift-hotkey-kp-4 = [ "<Shift><Super>KP_4" ];
      app-shift-hotkey-kp-5 = [ "<Shift><Super>KP_5" ];
      app-shift-hotkey-kp-6 = [ "<Shift><Super>KP_6" ];
      app-shift-hotkey-kp-7 = [ "<Shift><Super>KP_7" ];
      app-shift-hotkey-kp-8 = [ "<Shift><Super>KP_8" ];
      app-shift-hotkey-kp-9 = [ "<Shift><Super>KP_9" ];
      appicon-margin = 8;
      appicon-padding = 4;
      available-monitors = [ 0 1 ];
      dot-position = "BOTTOM";
      group-apps = false;
      hotkeys-overlay-combo = "TEMPORARILY";
      isolate-monitors = true;
      leftbox-padding = -1;
      panel-anchors = ''
        {"0":"MIDDLE","1":"MIDDLE"}
      '';
      panel-lengths = ''
        {"0":100,"1":100}
      '';
      panel-sizes = ''
        {"0":36,"1":36}
      '';
      primary-monitor = 0;
      status-icon-padding = -1;
      tray-padding = -1;
      window-preview-title-position = "TOP";
    };

    "org/gnome/shell/extensions/mediacontrols" = {
      mouse-actions = [ "toggle_play" "toggle_menu" "none" "none" "none" "none" "none" "none" ];
      show-control-icons-next = false;
      show-control-icons-previous = false;
      show-control-icons-seek-backward = false;
      show-control-icons-seek-forward = false;
      show-label = false;
      show-next-icon = false;
      show-player-icon = false;
      show-prev-icon = false;
      show-seek-back = false;
      show-seek-forward = false;
      show-seperators = false;
      show-sources-menu = false;
      show-text = false;
    };

    "org/gnome/shell/world-clocks" = {
      locations = [];
    };

    "org/gnome/software" = {
      check-timestamp = mkInt64 1707710496;
      first-run = false;
      flatpak-purge-timestamp = mkInt64 1707696029;
    };

    "org/gnome/tweaks" = {
      show-extensions-notice = false;
    };

    "org/gtk/gtk4/settings/file-chooser" = {
      date-format = "regular";
      location-mode = "path-bar";
      show-hidden = true;
      show-size-column = true;
      show-type-column = true;
      sidebar-width = 140;
      sort-column = "name";
      sort-directories-first = true;
      sort-order = "ascending";
      type-format = "category";
      view-type = "list";
      window-size = mkTuple [ 859 372 ];
    };

    "org/gtk/settings/file-chooser" = {
      clock-format = "12h";
      date-format = "regular";
      location-mode = "path-bar";
      show-hidden = false;
      show-size-column = true;
      show-type-column = true;
      sidebar-width = 157;
      sort-column = "name";
      sort-directories-first = false;
      sort-order = "ascending";
      type-format = "category";
      window-position = mkTuple [ 26 23 ];
      window-size = mkTuple [ 1203 902 ];
    };

  };
}

doc: error in readme

In the readme example, current=uint32 0 is converted to current = "uint32 0";

However, it should be current = lib.hm.gvariant.mkUint32 0

I assume the program behaviour is correct and it is a typo in the readme only, since this function exists

Negative term in mkTuple

Using dfconf2nix as found in https://gvolpe.com/blog/gnome3-on-nixos/ (excellent guide thank you), it gave a .nix file which contains a syntax error in mkTuple.

If either of the two numbers is negative, it is an "unexpected '-'" to the syntax checker of Nix. This came up in the "org/gnome/settings-daemon/plugins/color/night-light-last-coordinates" section of the dconf.settings.

I made it a string ("-71.xxxx" instead of -71.xxxx) and there is no longer a syntax error but I don't know if it is still performing correctly.

Have you seen this before?

Thank you

Support variant and dictionary types

The Problem

Two new gvariant types were recently added to HM: nix-community/home-manager@864ff68

The Solution

Leverage both hm.gvariant.type.variant and hm.gvariant.type.dictionaryEntryOf types.

Alternatives

No response

Additional context

No response

Happens in the latest version

  • Yes, this feature is still missing.

Importing with home-manager module

Type of bug

Other (please add details in additional context)

Version

0.0.12

Did you test against master?

  • Certainly

Error message (if not timeout)

No response

DConf input

No response

Additional context

So, this is bit awkward, but I use the home-manager nixos module and I do not know how to import the file so that it works, I'm getting:

error: attribute 'hm' missing, at /etc/nixos/config/gnome/dconf.nix:4:6

Support NixOS module

The Problem

NixOS now supports dconf database generation: NixOS/nixpkgs#234615

The Solution

Add --nixos flag that will make the following changes:

  • lib.gvariant generates instead of lib.hm.gvariant
  • mkDictionaryEntry takes two arguments instead of a list.
  • int32 needs to be explicitly constructed with mkInt32 (no implicit number literal)

Alternatives

No response

Additional context

No response

Happens in the latest version

  • Yes, this feature is still missing.

Special unicode character causes timeout

Type of bug

Timeout

Version

0.0.12

Did you test against master?

  • Certainly

Error message (if not timeout)

cat test.conf | dconf2nix --verbose
dconf: "[org/gnome/Characters]\nrecent-characters=['\10149']\n"
dconf2nix: πŸ’₯ The process timed out.

DConf input

[org/gnome/Characters]
recent-characters=['βž₯']

Additional context

I developed this method to identify the problematic part of the dconf output - maybe this can be helpful for troubleshooting

1. Split dconf in parts on each newline - http://stackoverflow.com/questions/33294986/ddg#33297878

dconf dump / | awk -v RS= '{print > ("dconf-" NR ".conf")}'

2. Try dconf2nix on all parts to identify & print the problematic part

for f in dconf-*.conf; do
    echo -n $f
    if dconf2nix -e < $f > /dev/null 2>&1; then
        echo " -> SUCCESS"
    else
        echo " -> ERROR:"
        cat $f
        echo #newline
    fi
done

Fail to parse escaped quotes in a string

Using dconf2nix v0.0.10.

[org/gnome/shell/extensions/arcmenu]
arc-menu-placement='DTP'
available-placement=[false, true, false]
custom-hot-corner-cmd="sh -c 'notify-send \"$(date)\"'"

Automate version generation

Right now the version has to be manually written. It would be great if this can be automated. E.g. read it from cabal or from another versioning file.

support a{sv} types

The Problem

right now dconf2nix interprets a{sv} types as strings, but putting quotes around them makes them interpreted as strings which will not be interpreted

The Solution

understand a{sv} types, for example

{'org.wezfurlong.wezterm': <{'padding': <{'left': <uint32 13>, 'right': <uint32 14>, 'top': <uint32 29>, 'bottom': <uint32 13>}>, 'keep_rounded_corners': <{'maximized': <false>, 'fullscreen': <false>}>, 'border_radius': <uint32 12>, 'smoothing': <uint32 0>, 'enabled': <true>}>}

Alternatives

i can't think of one

Additional context

support for a{sv} types may also need to be added to home manager, in the form of sets as accepted datatypes possibly ?

Happens in the latest version

  • Yes, this feature is still missing.

dconf2nix should invert special case for empty string lists

The fix for nix-community/home-manager#769 introduced a special case for empty string lists when parsing the config. In short the following mapping happens:

[] -> @as []

See the logic here: nix-community/home-manager@5d054ab#diff-1afc90afe9ca8ef2ec31b8fcee765e03d38679506e051053848e4b14aed57bbaR22.

dconf2nix should invert this logic, so the following mapping happens:

@as [] -> []

Currently, this configuration value maps to

"@as []"

This mapping breaks keybindings which unset keys.

Fails if values are lists with strings containing `=`

Buit from master(a7ce581)

Input

[org/gnome/evolution-data-server/calendar]
reminders-snoozed=['=']

Error:

dconf: "[org/gnome/evolution-data-server/calendar]\nreminders-snoozed=['=']\n"
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github, indicating dconf2nix's version. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main

List of errors I encountered

Version: 0.1.1

Here is a list of errors that I encountered when parsing my just exported dconf, it might be useful, if not, feel free to close the Issue.

First

Error

unexpected "d"
expecting white space, "@", "{", "[", "'", "false", "true", "-", digit, "uint32 ", "int64 ", "\"", "(" or "<("
CallStack (from HasCallStack):
error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.1.1-Kj3okwrvVsmLXSmJ1JaeH6:DConf2Nix

Content

locations=[<(uint32 2, <('City', 'UDYZ', false, [(0.5, 0.5)], @a(dd) [])>)>]
Second

Error

unexpected "{"
expecting "<("
CallStack (from HasCallStack):
error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.1.1-Kj3okwrvVsmLXSmJ1JaeH6:DConf2Nix

Content

app-picker-layout=[{'Utilities': <{'position': <0>}>, '1password.desktop': <{'position': <1>}>, 'org.gnome.Weather.desktop': <{'position': <2>}>, 'steam.desktop': <{'position': <3>}>, 'org.gnome.Calculator.desktop': <{'position': <4>}>, 'org.gnome.Settings.desktop': <{'position': <5>}>, 'org.gnome.Calendar.desktop': <{'position': <6>}>, 'discord.desktop': <{'position': <7>}>, 'com.github.wwmm.easyeffects.desktop': <{'position': <8>}>}]
Third

Error

unexpected "@"
expecting "<("
CallStack (from HasCallStack):
error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.1.1-Kj3okwrvVsmLXSmJ1JaeH6:DConf2Nix

Content

overridden-settings={'org.gnome.mutter.edge-tiling': <@mb nothing>, 'org.gnome.desktop.wm.keybindings.maximize': <@mb nothing>, 'org.gnome.desktop.wm.keybindings.unmaximize': <@mb nothing>, 'org.gnome.mutter.keybindings.toggle-tiled-left': <@mb nothing>, 'org.gnome.mutter.keybindings.toggle-tiled-right': <@mb nothing>}

Support dumping custom paths instead of just `/`

Dumped Tilix config

❯ dconf dump /com/gexperts/Tilix/
[profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d]
font='MesloLGS Nerd Font 11'
use-system-font=false
visible-name='Default'

Converted Tilix config

❯ dconf2nix -i tilix.conf -o tilix.nix
# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix
{ lib, ... }:

let
  mkTuple = lib.hm.gvariant.mkTuple;
in
{
  dconf.settings = {
    "profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d" = {
      "font" = "MesloLGS Nerd Font 10";
      "use-system-font" = false;
      "visible-name" = "Default";
    };

  };
}

Resulting incorrect dconf config

❯ dconf dump /profiles/
[2b7c4080-0ddd-46c5-8f23-563fd3ba789d]
font='MesloLGS Nerd Font 11'
use-system-font=false
visible-name='Default'

The config that actually works

{
  home-manager.users.austin = { pkgs, ... }: {
    dconf.settings = {
      "com/gexperts/Tilix/profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d" = {
        font = "MesloLGS Nerd Font 11";
        use-system-font = false;
        visible-name = "Default";
      };
    };
  };
}

Timeout while running dconf2nix

Using as this:

dconf dump / > dconf.settings
dconf2nix -i dconf.settings -o dconf.nix -t20 --verbose

Logs:

dconf: "[apps/seahorse/listing]\nkeyrings-selected=['openssh:///home/willian/.ssh']\n\n[apps/seahorse/windows/key-manager]\nheight=476\nwidth=1009\n\n[org/gnome/Disks]\nimage-dir-uri='file:///home/willian/Documents'\n\n[org/gnome/Geary]\ncompose-as-html=true\ncomposer-window-size=[680, 600]\nformatting-toolbar-visible=false\nmigrated-config=true\n\n[org/gnome/Music]\nwindow-maximized=true\nwindow-position=[0, 0]\nwindow-size=[1920, 1048]\n\n[org/gnome/Totem]\nactive-plugins=['screensaver', 'movie-properties', 'apple-trailers', 'save-file', 'open-directory', 'vimeo', 'variable-rate', 'autoload-subtitles', 'rotation', 'media-player-keys', 'recent', 'screenshot', 'skipto']\nsubtitle-encoding='UTF-8'\n\n[org/gnome/baobab/ui]\nwindow-size=(960, 600)\nwindow-state=87168\n\n[org/gnome/calendar]\nactive-view='month'\nwindow-maximized=true\nwindow-position=(0, 0)\nwindow-size=(1920, 1048)\n\n[org/gnome/clocks/state/window]\npanel-id='world'\nsize=(870, 690)\nstate=87168\n\n[org/gnome/control-center]\nlast-panel='sound'\n\n[org/gnome/desktop/app-folders]\nfolder-children=['Utilities', 'YaST']\n\n[org/gnome/desktop/app-folders/folders/Utilities]\napps=['gnome-abrt.desktop', 'gnome-system-log.desktop', 'nm-connection-editor.desktop', 'org.gnome.baobab.desktop', 'org.gnome.Connections.desktop', 'org.gnome.DejaDup.desktop', 'org.gnome.Dictionary.desktop', 'org.gnome.DiskUtility.desktop', 'org.gnome.eog.desktop', 'org.gnome.Evince.desktop', 'org.gnome.FileRoller.desktop', 'org.gnome.fonts.desktop', 'org.gnome.seahorse.Application.desktop', 'org.gnome.tweaks.desktop', 'org.gnome.Usage.desktop', 'vinagre.desktop']\ncategories=['X-GNOME-Utilities']\nname='X-GNOME-Utilities.directory'\ntranslate=true\n\n[org/gnome/desktop/app-folders/folders/YaST]\ncategories=['X-SuSE-YaST']\nname='suse-yast.directory'\ntranslate=true\n\n[org/gnome/desktop/background]\ncolor-shading-type='solid'\npicture-options='zoom'\npicture-uri='file:///nix/store/ymjq3grahqkq0kynsrxxjabzhqg6la0z-gnome-backgrounds-41.0/share/backgrounds/gnome/adwaita-timed.xml'\nprimary-color='#3465a4'\nsecondary-color='#000000'\n\n[org/gnome/desktop/calendar]\nshow-weekdate=false\n\n[org/gnome/desktop/input-sources]\nper-window=false\nsources=[('xkb', 'gb+extd')]\nxkb-options=['terminate:ctrl_alt_bksp']\n\n[org/gnome/desktop/interface]\nfont-antialiasing='grayscale'\nfont-hinting='slight'\ngtk-im-module='gtk-im-context-simple'\ngtk-theme='Adwaita-dark'\nmonospace-font-name='MesloLGS NF 10'\nshow-battery-percentage=false\n\n[org/gnome/desktop/notifications]\napplication-children=['gnome-power-panel', 'steam', 'zoom', 'deluge', 'fr-handbrake-ghb', 'google-chrome', 'gnome-network-panel', 'idea-community']\n\n[org/gnome/desktop/notifications/application/codium]\napplication-id='codium.desktop'\n\n[org/gnome/desktop/notifications/application/deluge]\napplication-id='deluge.desktop'\n\n[org/gnome/desktop/notifications/application/discord]\napplication-id='discord.desktop'\n\n[org/gnome/desktop/notifications/application/fr-handbrake-ghb]\napplication-id='fr.handbrake.ghb.desktop'\n\n[org/gnome/desktop/notifications/application/gnome-network-panel]\napplication-id='gnome-network-panel.desktop'\n\n[org/gnome/desktop/notifications/application/gnome-power-panel]\napplication-id='gnome-power-panel.desktop'\n\n[org/gnome/desktop/notifications/application/gnome-printers-panel]\napplication-id='gnome-printers-panel.desktop'\n\n[org/gnome/desktop/notifications/application/google-chrome]\napplication-id='google-chrome.desktop'\n\n[org/gnome/desktop/notifications/application/idea-community]\napplication-id='idea-community.desktop'\n\n[org/gnome/desktop/notifications/application/org-gnome-evolution-alarm-notify]\napplication-id='org.gnome.Evolution-alarm-notify.desktop'\n\n[org/gnome/desktop/notifications/application/org-gnome-geary]\napplication-id='org.gnome.Geary.desktop'\n\n[org/gnome/desktop/notifications/application/org-gnome-gedit]\napplication-id='org.gnome.gedit.desktop'\n\n[org/gnome/desktop/notifications/application/org-gnome-nautilus]\napplication-id='org.gnome.Nautilus.desktop'\n\n[org/gnome/desktop/notifications/application/org-gnome-shell-extensions-gsconnect-preferences]\napplication-id='org.gnome.Shell.Extensions.GSConnect.Preferences.desktop'\n\n[org/gnome/desktop/notifications/application/steam]\napplication-id='steam.desktop'\n\n[org/gnome/desktop/notifications/application/vlc]\napplication-id='vlc.desktop'\n\n[org/gnome/desktop/notifications/application/zoom]\napplication-id='Zoom.desktop'\n\n[org/gnome/desktop/peripherals/keyboard]\nnumlock-state=true\n\n[org/gnome/desktop/privacy]\ndisable-microphone=false\n\n[org/gnome/desktop/screensaver]\ncolor-shading-type='solid'\npicture-options='zoom'\npicture-uri='file:///nix/store/ymjq3grahqkq0kynsrxxjabzhqg6la0z-gnome-backgrounds-41.0/share/backgrounds/gnome/adwaita-timed.xml'\nprimary-color='#3465a4'\nsecondary-color='#000000'\n\n[org/gnome/desktop/search-providers]\nsort-order=['org.gnome.Contacts.desktop', 'org.gnome.Documents.desktop', 'org.gnome.Nautilus.desktop']\n\n[org/gnome/desktop/session]\nidle-delay=uint32 0\n\n[org/gnome/desktop/sound]\nevent-sounds=true\ntheme-name='__custom'\n\n[org/gnome/desktop/wm/preferences]\nbutton-layout='appmenu:minimize,maximize,close'\n\n[org/gnome/eog/view]\nbackground-color='rgb(0,0,0)'\nuse-background-color=true\n\n[org/gnome/epiphany/state]\nis-maximized=false\nwindow-position=(-1, -1)\nwindow-size=(1024, 768)\n\n[org/gnome/evolution-data-server]\nmigrated=true\nnetwork-monitor-gio-name=''\n\n[org/gnome/evolution-data-server/calendar]\nreminders-past=['9252a789a1d6161f2a3bb3791f63900874817712\\n1b4ff2a46c7ad163a8b857f1ff96a84e1c762726\\t20220113T140000\\n1641992400\\n1642078800\\n1642082400\\nBEGIN:VEVENT\\r\\nDTSTART;TZID=Europe/Madrid:20220113T140000\\r\\nDTEND;TZID=Europe/Madrid:20220113T150000\\r\\nDTSTAMP:20211216T134400Z\\r\\nUID:[email protected]\\r\\nCREATED:20211216T134400Z\\r\\nX-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for DESCRIPTION \\r\\n property. Removing entire property:\\r\\nLAST-MODIFIED:20211216T134400Z\\r\\nX-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for LOCATION \\r\\n property. Removing entire property:\\r\\nSEQUENCE:0\\r\\nSTATUS:CONFIRMED\\r\\nSUMMARY:Mesico\\r\\nTRANSP:OPAQUE\\r\\nX-EVOLUTION-CALDAV-ETAG:63775345440\\r\\nBEGIN:VALARM\\r\\nACTION:EMAIL\\r\\nDESCRIPTION:This is an event reminder\\r\\nSUMMARY:Alarm notification\\r\\nATTENDEE:mailto:[email protected]\\r\\nTRIGGER:-PT10M\\r\\nX-EVOLUTION-ALARM-UID:cd57e6a0b154c510d615b71759160a6233745e72\\r\\nEND:VALARM\\r\\nBEGIN:VALARM\\r\\nACTION:DISPLAY\\r\\nDESCRIPTION:This is an event reminder\\r\\nTRIGGER:-PT30M\\r\\nX-EVOLUTION-ALARM-UID:5a4bb1baf949735ed5803794d89a8af719c3e8cc\\r\\nEND:VALARM\\r\\nBEGIN:VALARM\\r\\nACTION:DISPLAY\\r\\nDESCRIPTION:This is an event reminder\\r\\nTRIGGER:-P1D\\r\\nX-EVOLUTION-ALARM-UID:1b4ff2a46c7ad163a8b857f1ff96a84e1c762726\\r\\nEND:VALARM\\r\\nEND:VEVENT\\r\\n']\n\n[org/gnome/gedit/plugins]\nactive-plugins=['filebrowser', 'docinfo', 'spell', 'sort', 'modelines']\n\n[org/gnome/gedit/plugins/filebrowser]\nroot='file:///'\ntree-view=true\nvirtual-root='file:///home/willian/.my-nix-os/system'\n\n[org/gnome/gedit/preferences/ui]\nshow-tabs-mode='auto'\n\n[org/gnome/gedit/state/window]\nbottom-panel-size=140\nside-panel-active-page='GeditWindowDocumentsPanel'\nside-panel-size=200\nsize=(900, 700)\nstate=87168\n\n[org/gnome/gnome-screenshot]\ndelay=0\ninclude-pointer=false\nlast-save-directory='file:///home/willian/Pictures'\n\n[org/gnome/gnome-system-monitor]\ncurrent-tab='resources'\nmaximized=false\nnetwork-total-in-bits=false\nshow-dependencies=false\nshow-whose-processes='user'\nwindow-state=(700, 500)\n\n[org/gnome/gnome-system-monitor/disktreenew]\ncol-0-visible=true\ncol-0-width=437\ncol-6-visible=true\ncol-6-width=0\n\n[org/gnome/gnome-system-monitor/proctree]\ncolumns-order=[0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]\nsort-col=8\nsort-order=0\n\n[org/gnome/mutter]\nattach-modal-dialogs=true\ndynamic-workspaces=true\nedge-tiling=true\nfocus-change-on-pointer-rest=true\nworkspaces-only-on-primary=true\n\n[org/gnome/nautilus/icon-view]\ndefault-zoom-level='large'\n\n[org/gnome/nautilus/preferences]\ndefault-folder-viewer='list-view'\nsearch-filter-time-type='last_modified'\nsearch-view='list-view'\n\n[org/gnome/nautilus/window-state]\ninitial-size=(890, 550)\nmaximized=false\n\n[org/gnome/nm-applet/eap/41860233-f35f-42ba-be46-be9cf1128443]\nignore-ca-cert=false\nignore-phase2-ca-cert=false\n\n[org/gnome/nm-applet/eap/df7aacf2-195d-4ac2-ad5d-485bd6d3c864]\nignore-ca-cert=false\nignore-phase2-ca-cert=false\n\n[org/gnome/nm-applet/eap/e8f53794-9636-4a95-866f-c16186dd4c4d]\nignore-ca-cert=false\nignore-phase2-ca-cert=false\n\n[org/gnome/nm-applet/eap/f183661b-61e6-4c6f-80c4-e573b33f3613]\nignore-ca-cert=false\nignore-phase2-ca-cert=false\n\n[org/gnome/photos]\nwindow-maximized=true\n\n[org/gnome/settings-daemon/plugins/power]\nidle-dim=false\nsleep-inactive-ac-type='nothing'\nsleep-inactive-battery-type='suspend'\n\n[org/gnome/shell]\ndisable-user-extensions=false\ndisabled-extensions=@as []\nenabled-extensions=['[email protected]', '[email protected]', '[email protected]']\nfavorite-apps=['google-chrome.desktop', 'codium.desktop', 'idea-community.desktop', 'org.gnome.Calendar.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Terminal.desktop']\nhad-bluetooth-devices-setup=true\nwelcome-dialog-last-shown-version='41.1'\n\n[org/gnome/shell/extensions/gsconnect]\nid='061888b5-76bd-4174-8464-b1ddb6563934'\nname='nixos'\nshow-indicators=false\n\n[org/gnome/shell/extensions/gsconnect/preferences]\nwindow-maximized=false\nwindow-size=(640, 440)\n\n[org/gnome/shell/world-clocks]\nlocations='@av []'\n\n[org/gnome/software]\ncheck-timestamp=int64 1642710454\nonline-updates-timestamp='int64 1637571160'\nupdate-notification-timestamp='int64 1637571160'\n\n[org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9]\nfont='MesloLGS Nerd Font Mono 11'\nuse-system-font=true\n\n[org/gnome/tweaks]\nshow-extensions-notice=false\n\n[org/gtk/settings/color-chooser]\ncustom-colors=[(0.286275, 0.65882399999999997)]\nselected-color=(true, 0.286275)\n\n[org/gtk/settings/file-chooser]\ndate-format='regular'\nlocation-mode='path-bar'\nshow-hidden=true\nshow-size-column=true\nshow-type-column=true\nsidebar-width=157\nsort-column='name'\nsort-directories-first=false\nsort-order='descending'\ntype-format='category'\nwindow-position=(2232, 82)\nwindow-size=(1297, 902)\n"
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main

Guarantee termination even in case of failure

Whenever there's a parsing error, the program would hang at the moment. If not running with the --verbose flag, the user would never understand what's going on so better to terminate with an error.

Unable to parse variants (e.g. weather information)

When obfuscated, it comes as follows:

[org/gnome/shell/weather]
locations=[<(uint32 2, <('GdaΕ„sk', 'EPGD', true, [(0.94916821905848536, 0.32230414101938371)], [(0.94858644845891815, 0.32579479952337237)])>)>, <(uint32 2, <('Gdynia, DziaΕ‚dowo County, Warmian-Masurian Voivodeship', '', false, [(0.93027949445787339, 0.34699627038777753)], [(0.93861053042695397, 0.35744550775024858)])>)>, <(uint32 2, <('Gdynia, Pomeranian Voivodeship', '', false, [(0.95149239024756216, 0.32358882203124067)], [(0.94858644845891815, 0.32579479952337237)])>)>]

When slightly formatted, we can tell that <()> are some kind of tuples πŸ‘€ in dconf:

locations=[
  <(
    uint32 2, 
    <(
      'GdaΕ„sk', 
      'EPGD', 
      true, 
      [(0.94916821905848536, 0.32230414101938371)], 
      [(0.94858644845891815, 0.32579479952337237)]
    )>
  )>, 
  <(
    uint32 2, 
    <(
      'Gdynia, DziaΕ‚dowo County, Warmian-Masurian Voivodeship', 
      '', 
      false, 
      [(0.93027949445787339, 0.34699627038777753)], 
      [(0.93861053042695397, 0.35744550775024858)]
    )>
  )>, 
  <(
    uint32 2, 
    <(
      'Gdynia, Pomeranian Voivodeship', 
      '', 
      false, 
      [(0.95149239024756216, 0.32358882203124067)], 
      [(0.94858644845891815, 0.32579479952337237)]
    )>
  )>
]

Reference: https://developer.gnome.org/glib/stable/gvariant-text.html

'|' character can cause timeout

Type of bug

Timeout

Version

0.0.11

Did you test against master?

  • Certainly

Error message (if not timeout)

[nix-shell:~/src/infrastructure/nixos/hosts/thalassa/null]$ dconf2nix -i b.settings -o out.nix
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github, indicating dconf2nix's version. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main

DConf input

[foo]
bar=['|']

Additional context

If I let it run long enough it just OOMs.

This is the original non-minimized snippet that caused the error:

[es/atareao/wireguard-indicator]
darktheme=false
nmcli=true
services=['service1|[email protected]', 'service2|[email protected]']
sudo=false

Unable to parse /org/gnome/{clocks/, desktop/input-sources/} and /desktop/ibus/panel/emoji/favorites

✦ ➜ for k in clocks/ desktop/input-sources/;                                                                                                          23:48:24
        echo $k; dconf dump /org/gnome/$k | dconf2nix --timeout 5 --verbose 1>/dev/null
    end
clocks/
dconf: "[/]\nworld-clocks=[{'location': <(uint32 2, <('Houston', 'KHOU', false, [(0.51727195705981943, -1.6629933445314968)], [(0.51727195705981943, -1.6629933445314968)])>)>}, {'location': <(uint32 2, <('Singapore', 'WSAP', true, [(0.023852838928353343, 1.8136879868485383)], [(0.022568084612667797, 1.8126262332513803)])>)>}]\n\n[state/window]\npanel-id='world'\nsize=(870, 690)\nstate=87168\n"
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main
desktop/input-sources/
dconf: "[/]\nmru-sources=[('xkb', 'us+altgr-intl'), ('ibus', 'mozc-jp')]\nsources=[('xkb', 'us+altgr-intl'), ('ibus', 'mozc-jp')]\nxkb-options=['terminate:ctrl_alt_bksp']\n"
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main

✦ ➜ dconf dump /desktop/ibus/panel/emoji/ | dconf2nix --timeout 5 --verbose 1>/dev/null                                                               23:57:37
dconf: "[/]\nfavorites=['\8211', '\8594', '\8593', '\8595', '\8482', '\\u00ad', '\176', '\\v', '\160', '\171', '\8451']\n"

(Using Fish shell if any of the syntax is unfamiliar. Also, piping stdout to /dev/null to avoid even more noisy output, was mostly for debugging)

Let me know if you need any more information – hope this helps!

Dconf2nix hangs (see #52 and #53)

Alright so I made a dump of my dconf as described in readme, then I fed it to the tool, it timed out so I gave it a longer timeout .

Then my system got super laggy so I opened htop to find it using most of my systems 32 GB of memory. Will attach dconf file once my computer is usable again.IMG_20211210_191611.jpg

Fails if input doesn't end with newline

Type of bug

Parsing error

Version

0.0.12

Did you test against master?

  • Certainly

Error message (if not timeout)

dconf2nix: "<stdin>" (line 22, column 58):
unexpected end of input
expecting new-line
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.0.12-9hDiZbiWQlV5eVEmzDB7Zt:DConf2Nix

DConf input

No response

Additional context

No response

Syntax error when using world clocks

Thanks for this great tool! I installed from master using

$ nix-env -i -f https://github.com/gvolpe/dconf2nix/archive/master.tar.gz

And when I ran it, it produce the following incorrect line:

"org/gnome/clocks" = {
  world-clocks = ""[{'location': <(uint32 2, <('San Francisco', 'KOAK', true, [(0.65832848982162007, -2.133408063190589)], [(0.659296885757089, -2.1366218601153339)])>)>}, {'location': <(uint32 2, <('London', 'EGWU', true, [(0.89971722940307675, -0.007272211034407213)], [(0.89884456477707964, -0.0020362232784242244)])>)>}, {'location': <(uint32 2, <('Stockholm', 'ESSB', true, [(1.0358529110586345, 0.31328660073298215)], [(1.0355620170322046, 0.31503192998497648)])>)>}]"";
};

The double quotes cause a parsing error.

I also ran into #31, though that issue was closed, so I'm a little confused what happened there.

Unable to parse numbers in scientific notation

Input:


[com/github/wwmm/easyeffects/streamoutputs/bassenhancer]
amount=-6.9388939039072284e-16
blend=0.0
listen=true

(valid config for easyeffects)

Output:

dconf2nix: "<stdin>" (line 74, column 27):
unexpected "e"
expecting digit or new-line
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.0.8-ADjdFpOZHMDCBz9zkj4k3n:DConf2Nix

Fail to parse tuple of more than two elements

Type of bug

Timeout

Version

0.0.12

Did you test against master?

  • Certainly

Error message (if not timeout)

No response

DConf input

[org/gnome/calendar]
weather-settings=(true, false, 'Location Name, Direction', @mv <(unit_32 2, <('Location Name, Direction', '', false, [(0.000, 0.000)], [(0.000, 0.000)])>)>)

Additional context

No response

Timeout when there is % in a list

Type of bug

Timeout

Version

0.0.12

Did you test against master?

  • Certainly

Error message (if not timeout)

$ echo -e "[aaa]\naaa=['%']" | dconf2nix --verbose
dconf: "[aaa]\naaa=['%']\n"
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github, indicating dconf2nix's version. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main

DConf input

[aaa]
aaa=['%']

Additional context

No response

Using `mk` functions

I noticed in nix-community/home-manager#2249 that dconf2nix generates output in a "raw" dconf format, for example, the uint32 value 0 is emitted as a Nix string "uint32 0". This is not really the intended way to construct GVariant values in the HM library. The recommended way to emit values is to use the various mk functions as described in the manual (scroll down to where hm.types.gvariant starts).

For example, instead of having "uint32 0" one would use lib.hm.gvariant.mkUint32 0. Using the functions should be considerably more robust.

Btw, very neat project! Good job πŸ™‚

Add flakes support

It would be helpful if this had a flake.nix.
Would you be willing to take a pull request for that?

Quoted values appear double quoted

The following input:

[org/gnome/evince]
document-directory="@ms 'file:///home/user/Downloads'"

Produces the following (invalid?) output:

# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix
{ lib, ... }:

let
  mkTuple = lib.hm.gvariant.mkTuple;
in
{
  dconf.settings = {
    "org/gnome/evince" = {
      document-directory = ""@ms 'file:///home/user/Downloads'"";
    };
  };
}

Keyboard shortcut with quoted command gives invalid nix config

Hey, first of thanks for this plugin. Really makes managing my gnome state easier :)

I encountered a bug just now where I've added a keyboard shortcut:

<Super>space --> gnome-terminal -e "vim --cmd startinsert"

This fails to apply in the nix configuration:

building the system configuration...
error: undefined variable 'vim'

       at /nix/store/n3w211g7700r9d2h58qqj2fjs5hri2xq-source/home/dconf.nix:280:38:

          279|       binding = "<Super>space";
          280|       command = "'gnome-terminal -e "vim --cmd startinsert"'";
             |                                      ^
          281|       name = "Launch scratchpad";
(use '--show-trace' to show detailed location information)

Seems like quotes aren't escaped?

parsing error

Type of bug

Parsing error

Version

0.1.1

Did you test against master?

  • Certainly

Error message (if not timeout)

dconf2nix: "dconf.settings" (line 263, column 34):
unexpected "{"
expecting "<("
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.1.1-Kj3okwrvVsmLXSmJ1JaeH6:DConf2Nix

DConf input

[org/gnome/shell]
app-picker-layout=[{'Utilities': <{'position': <0>}>}]

Additional context

No response

Header namespaces separated by `.` are not supported

Hi there

I am getting the following error from my dconf export and attempted conversion;

dconf2nix: "dconf.settings" (line 160, column 4):
unexpected "."
expecting letter or digit, " ]", "]", "/", "-" or ":"
CallStack (from HasCallStack):
  error, called at src/DConf2Nix.hs:35:16 in dconf2nix-0.0.8-DdiL9AwJHriJYUd1qk7zL9:DConf2Nix

Offending dconf line 160 ;

160 [uk.co.ibboard.cawbird]
161 round-avatars=false
162 startup-accounts=['account_name']
163 window-geometry={'account_name': (30, 26, 694, 1182)}

It appears to be complaining about the dot after [uk and I wondered if is a bug or not supported?

Thanks in advance

Fails to convert GNOME Indexer Key

File:

[org/freedesktop/tracker/miner/files]
index-recursive-directories=['&DESKTOP', '&DOCUMENTS', '&MUSIC', '&PICTURES', '&VIDEOS', '&DOWNLOAD', '/data']

Output:

dconf2nix -i '/home/v7/Downloads/dconf' -o '/home/v7/Downloads/dconf.nix' --verbose
dconf: "[org/freedesktop/tracker/miner/files]\nindex-recursive-directories=['&DESKTOP', '&DOCUMENTS', '&MUSIC', '&PICTURES', '&VIDEOS', '&DOWNLOAD', '/data']\n"
dconf2nix: πŸ’₯ The process timed out.

  πŸ’‘ You can try increasing the timeout using --timeout.

  β›” If the issue persists, run it again using --verbose and report the issue on Github. Sorry 😞.

CallStack (from HasCallStack):
  error, called at app/Main.hs:30:14 in main:Main

Use mkDouble for doubles

Type of bug

Other (please add details in additional context)

Version

0.1.1

Did you test against master?

  • Certainly

Error message (if not timeout)

No response

DConf input

[org/gnome/shell/world-clocks]
locations=[<(uint32 2, <('San Francisco', 'KSFO', false, [(0.65658801258494626, -2.1356672871875406)], [(0.65658801258494626, -2.1356672871875406)])>)>, <(uint32 2, <('New York', 'KNYC', true, [(0.71180344078725644, -1.2909618758762367)], [(0.71059804659265924, -1.2916478949920254)])>)>, <(uint32 2, <('Coordinated Universal Time (UTC)', '@UTC', false, @a(dd) [], @a(dd) [])>)>, <(uint32 2, <('Prague', 'LKKB', true, [(0.87478393392930087, 0.25383384995537522)], [(0.87411906122272931, 0.25249097093961048)])>)>, <(uint32 2, <('Sydney', 'YSSY', true, [(-0.59253928105207498, 2.6386469349889961)], [(-0.59137572239964786, 2.6392287230418559)])>)>]

Additional context

Even though Nix uses float64 internally, it cannot print it correctly: NixOS/nix#5733 (comment)
This reportedly leads to values being rewritten #85 (comment)

Filtering

The Problem

I want to keep some docnf settings dynamic, so I can change them freely with direct OS usage.

For example, some apps store the last window position. Dumping that into a home-manager configuration makes no sense.

I still want other settings stored into home-manager.

The Solution

I'd love to have some filters in dream2nix that allow me to include only certain paths, or exclude certain others. Some examples:

dconf dump / | dconf2nix --include /org/gnome/clocks --exclude /org/gnome/clocks/state

Alternatives

https://gitlab.com/yajoman/minfra/-/commit/415fd867176cdc9a9353538212567918ff9deb35

Additional context

No response

Happens in the latest version

  • Yes, this feature is still missing.

JSON-like values still need a tiny fix

This is a follow up of issue #37

I've tested a little deeper the solution proposed in PR #38 and noticed that home-manager switch returns the following error message:

error: Key file contains line β€œ'” which is not a key-value pair, group, or comment

In order to avoid this error, I need to remove the line breaks within the quotes, like this:

"org/gnome/shell/extensions/sound-output-device-chooser" = {
  ports-settings = ''{"version":2,"ports":[]}'';
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.