mat.services/nix/themes.nix

15 lines
374 B
Nix
Raw Normal View History

2022-08-27 18:42:04 +00:00
{ lib, theme, themeEnabled }:
let
themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name);
in
{
copyTheme = lib.optionalString themeEnabled ''
mkdir -p themes/${themeName}
cp -r ${theme}/* themes/${themeName}
'';
linkTheme = lib.optionalString themeEnabled ''
mkdir -p themes
ln -snf "${theme}" "themes/${themeName}"
'';
}