mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-03 23:51:03 +01:00
wofi: allow path to style.css (#6966)
This commit is contained in:
parent
d1bbab6b04
commit
64f7d5e6b9
3 changed files with 24 additions and 6 deletions
|
|
@ -42,11 +42,7 @@ in
|
||||||
|
|
||||||
style = mkOption {
|
style = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.lines;
|
type = with types; nullOr (either lines path);
|
||||||
description = ''
|
|
||||||
CSS style for wofi to use as a stylesheet. See
|
|
||||||
{manpage}`wofi(7)`.
|
|
||||||
'';
|
|
||||||
example = ''
|
example = ''
|
||||||
* {
|
* {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
|
|
@ -56,6 +52,10 @@ in
|
||||||
background-color: #7c818c;
|
background-color: #7c818c;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
description = ''
|
||||||
|
CSS style for wofi to use as a stylesheet. See
|
||||||
|
{manpage}`wofi(7)`
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -70,7 +70,12 @@ in
|
||||||
(mkIf (cfg.settings != { }) {
|
(mkIf (cfg.settings != { }) {
|
||||||
"wofi/config".text = toConfig cfg.settings;
|
"wofi/config".text = toConfig cfg.settings;
|
||||||
})
|
})
|
||||||
(mkIf (cfg.style != null) { "wofi/style.css".text = cfg.style; })
|
(
|
||||||
|
let
|
||||||
|
styleFile = if lib.isString cfg.style then pkgs.writeText "wofi-style" cfg.style else cfg.style;
|
||||||
|
in
|
||||||
|
mkIf (cfg.style != null) { "wofi/style.css".source = styleFile; }
|
||||||
|
)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
wofi-basic-configuration = ./basic-configuration.nix;
|
wofi-basic-configuration = ./basic-configuration.nix;
|
||||||
wofi-empty-configuration = ./empty-configuration.nix;
|
wofi-empty-configuration = ./empty-configuration.nix;
|
||||||
|
wofi-style-local-file = ./style-local-file.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
tests/modules/programs/wofi/style-local-file.nix
Normal file
12
tests/modules/programs/wofi/style-local-file.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
programs.wofi = {
|
||||||
|
enable = true;
|
||||||
|
style = ./basic-style.css;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/wofi/style.css
|
||||||
|
assertFileContent home-files/.config/wofi/style.css \
|
||||||
|
${./basic-style.css}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue