1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-16 16:19:44 +01:00
home-manager/tests/modules/programs/rofi/valid-config.nix
Thiago Kenji Okada 6f7074d21d
rofi: migrate to rasi configuration format (#1736)
* rofi: migrate to rasi configuration format

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.

* docs: document programs.rofi.extraConfig changes

* rofi: add thiagokokada as maintainer

* rofi: add toRasi function
2021-01-23 16:30:34 +01:00

57 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.rofi = {
enable = true;
width = 100;
lines = 10;
borderWidth = 1;
rowHeight = 1;
padding = 400;
font = "Droid Sans Mono 14";
scrollbar = true;
terminal = "/some/path";
separator = "solid";
cycle = false;
fullscren = true;
colors = {
window = {
background = "argb:583a4c54";
border = "argb:582a373e";
separator = "#c3c6c8";
};
rows = {
normal = {
background = "argb:58455a64";
foreground = "#fafbfc";
backgroundAlt = "argb:58455a64";
highlight = {
background = "#00bcd4";
foreground = "#fafbfc";
};
};
};
};
window = {
background = "background";
border = "border";
separator = "separator";
};
extraConfig = {
modi = "drun,emoji,ssh";
kb-primary-paste = "Control+V,Shift+Insert";
kb-secondary-paste = "Control+v,Insert";
};
};
nmt.script = ''
assertFileContent \
home-files/.config/rofi/config.rasi \
${./valid-config-expected.rasi}
'';
};
}