Skip to content

Commit 101e102

Browse files
committed
update docs
1 parent 9b44d67 commit 101e102

File tree

1 file changed

+35
-41
lines changed

1 file changed

+35
-41
lines changed

README.md

+35-41
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A convenient converter of [DConf](https://wiki.gnome.org/Projects/dconf) files t
99
* [Introduction](#introduction)
1010
* [Run](#run)
1111
* [Custom root](#custom-root)
12+
* [Emoji support](#emoji-support)
1213
* [Supported types](#supported-types)
1314
* [Gnome Shell configuration](#gnome-shell-configuration)
1415
* [Installation](#installation)
@@ -108,9 +109,9 @@ Type `--help` for some more information.
108109
dconf2nix - Nixify dconf configuration files
109110

110111
Usage: dconf2nix [-v|--version]
111-
[[-r|--root ARG] [-t|--timeout ARG] [--verbose] |
112+
[[-r|--root ARG] [-t|--timeout ARG] [-e|--emoji] [--verbose] |
112113
(-i|--input ARG) (-o|--output ARG) [-r|--root ARG]
113-
[-t|--timeout ARG] [--verbose]]
114+
[-t|--timeout ARG] [-e|--emoji] [--verbose]]
114115
Convert a dconf file into a Nix file, as expected by Home Manager.
115116

116117
Available options:
@@ -119,12 +120,14 @@ Available options:
119120
-r,--root ARG Custom root path. e.g.: system/locale/
120121
-t,--timeout ARG Timeout in seconds for the conversion
121122
process (default: 5)
123+
-e,--emoji Enable emoji support (adds a bit of overhead)
122124
--verbose Verbose mode (debug)
123125
-i,--input ARG Path to the dconf file (input)
124126
-o,--output ARG Path to the Nix output file (to be created)
125127
-r,--root ARG Custom root path. e.g.: system/locale/
126128
-t,--timeout ARG Timeout in seconds for the conversion
127129
process (default: 5)
130+
-e,--emoji Enable emoji support (adds a bit of overhead)
128131
--verbose Verbose mode (debug)
129132
```
130133

@@ -149,6 +152,26 @@ This will generate an output similar to the one below.
149152
}
150153
```
151154

155+
#### Emoji support
156+
157+
Emojis are supported since version `0.0.12`, and it needs to be explicitly enabled, as these add a little parsing overhead via the [emojis](https://hackage.haskell.org/package/emojis) package.
158+
159+
The following `dconf` input.
160+
161+
```ini
162+
[ org/gnome/Characters ]
163+
recent-characters=['💡']
164+
some-other-character=['🤓']
165+
```
166+
167+
Can be parsed as follows.
168+
169+
```console
170+
$ dconf2nix -i data/emoji.settings -o output/emoji.nix --emoji
171+
```
172+
173+
Failing to pass the `--emoji` flag will result in a timeout error.
174+
152175
### Supported types
153176

154177
For now, only types supported by Home Manager as specified [here](https://github.com/rycee/home-manager/blob/master/modules/lib/gvariant.nix) are supported. If there's enough interest, we might be able to work on supporting the [full specification](https://developer.gnome.org/glib/stable/gvariant-text.html).
@@ -182,48 +205,19 @@ If you are using the Home Manager module for NixOS you can import it like so:
182205

183206
### Installation
184207

185-
The simplest way is to install it via `nix-env`.
208+
`dconf2nix` is available on [nixpkgs](https://github.com/NixOS/nixpkgs) and can be installed as any other package. It can also be used without installing. For example, with flakes.
186209

187-
```shell
188-
nix-env -i dconf2nix
210+
```console
211+
$ nix run nixpkgs#dconf2nix -- --version
212+
<<< DCONF2NIX >>>
213+
Version: 0.0.12
214+
Maintainer: Gabriel Volpe (https://gvolpe.com)
215+
Source code: https://github.com/gvolpe/dconf2nix
189216
```
190217

191-
Or if you want to pull the latest `master`.
192-
193-
```shell
194-
nix-env -i -f https://github.com/gvolpe/dconf2nix/archive/master.tar.gz
195-
```
196-
197-
You could also use [Cachix](https://app.cachix.org/cache/dconf2nix) to reduce the installation time.
198-
199-
Alternatively, here's an overlay for the binary you can use to avoid compiling it (only for Linux-x86-64).
200-
201-
```nix
202-
self: super:
203-
204-
rec {
205-
dconf2nix = super.dconf2nix.overrideAttrs (
206-
old: rec {
207-
version = "v0.0.6";
208-
209-
src = builtins.fetchurl {
210-
url = "https://github.com/gvolpe/dconf2nix/releases/download/${version}/dconf2nix-linux-x86-64";
211-
sha256 = "1bh78hfgy4wnfdq184ck5yw72szllzl5sm7a3a4y46byq0xxklcd";
212-
};
213-
214-
phases = ["installPhase" "patchPhase"];
215-
216-
installPhase = ''
217-
mkdir -p $out/bin
218-
cp $src $out/bin/dconf2nix
219-
chmod +x $out/bin/dconf2nix
220-
'';
221-
}
222-
);
223-
}
224-
```
218+
To build it from source, it is recommend to use [Cachix](https://app.cachix.org/cache/dconf2nix) to reduce the compilation time.
225219

226-
Have a look at the [latest releases](https://github.com/gvolpe/dconf2nix/releases) in case the README file gets outdated.
220+
Have a look at the [latest releases](https://github.com/gvolpe/dconf2nix/releases) for more information.
227221

228222
### Troubleshooting
229223

@@ -237,7 +231,7 @@ To find which section caused the error you can download [d2n_util.sh](https://gi
237231
curl https://raw.githubusercontent.com/broccoli5/Scripts/main/bin/d2n_util.sh > d2n_util.sh && chmod +x d2n_util.sh
238232
```
239233

240-
You can then run: `dconf dump / | ./d2n_util.sh -t` to create the sections and automaticaly test them. When creating a issue include both, the sections which failed the test and the errors from "d2n.log". For more options run `./d2n_util.sh -h`
234+
You can then run: `dconf dump / | ./d2n_util.sh -t` to create the sections and automatically test them. When creating a issue include both, the sections which failed the test and the errors from "d2n.log". For more options run `./d2n_util.sh -h`
241235

242236
Do also consider the caveats mentioned above in the [Supported Types](#supported-types) section.
243237

0 commit comments

Comments
 (0)