eww: string based config
This commit is contained in:
parent
7e68e55d2e
commit
3182815f97
|
@ -22,18 +22,48 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
configDir = mkOption {
|
||||
type = types.path;
|
||||
example = literalExpression "./eww-config-dir";
|
||||
configYuck = mkOption {
|
||||
type = types.lines;
|
||||
example = literalExpression ''
|
||||
(defwindow example
|
||||
:monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "20px"
|
||||
:width "90%"
|
||||
:height "30px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:reserve (struts :distance "40px" :side "top")
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
"example content")
|
||||
'';
|
||||
description = ''
|
||||
The directory that gets symlinked to
|
||||
{file}`$XDG_CONFIG_HOME/eww`.
|
||||
The content that gets symlinked to
|
||||
{file} `$XDG_CONFIG_HOME/eww/eww.yuck`.
|
||||
'';
|
||||
};
|
||||
|
||||
configScss = mkOption {
|
||||
type = types.lines;
|
||||
example = literalExpression ''
|
||||
window {
|
||||
background: pink;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
The content that gets symlinked to
|
||||
{file} `$XDG_CONFIG_HOME/eww/eww.scss`
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
xdg.configFile."eww".source = cfg.configDir;
|
||||
xdg.configFile = {
|
||||
"eww/eww.yuck".text = cfg.configYuck;
|
||||
"eww/eww.scss".text = cfg.configScss;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ in import nmtSrc {
|
|||
./modules/programs/dircolors
|
||||
./modules/programs/direnv
|
||||
./modules/programs/emacs
|
||||
./modules/programs/eww
|
||||
./modules/programs/fastfetch
|
||||
./modules/programs/feh
|
||||
./modules/programs/fish
|
||||
|
|
32
tests/modules/programs/eww/basic-config.nix
Normal file
32
tests/modules/programs/eww/basic-config.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ pkgs, ... }: {
|
||||
config = {
|
||||
programs.eww = {
|
||||
enable = true;
|
||||
package = pkgs.writeScriptBin "dummy-eww" "";
|
||||
configYuck = ''
|
||||
(defwindow example
|
||||
:monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "20px"
|
||||
:width "90%"
|
||||
:height "30px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:reserve (struts :distance "40px" :side "top")
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
"example content")
|
||||
'';
|
||||
configScss = ''
|
||||
window {
|
||||
background: pink;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/eww/eww.yuck
|
||||
assertFileExists home-files/.config/eww/eww.scss
|
||||
'';
|
||||
};
|
||||
}
|
1
tests/modules/programs/eww/default.nix
Normal file
1
tests/modules/programs/eww/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ eww-basic-configuration = ./basic-config.nix; }
|
Loading…
Reference in a new issue