1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

improvement: use more nix library functions

This commit is contained in:
Kierán Meinhardt
2019-09-11 07:34:38 +02:00
parent 4d28abff2a
commit f4cae1278e
2 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,8 @@
{ config, lib, ... }:
let
inherit (lib.attrsets) nameValuePair listToAttrs;
inherit (lib.lists) imap0;
in
{
home-manager.users.me.xresources.properties = with config.niveum; {
"*background" = colours.background;
@@ -8,5 +12,5 @@
"*.font" = "xft:${fonts.terminal.name}:size=${toString fonts.terminal.size}";
"*.boldFont" = "xft:${fonts.terminal.name}:style=Bold:size=${toString fonts.terminal.size}";
"*.italicFont" = "xft:${fonts.terminal.name}:style=Italic:size=${toString fonts.terminal.size}";
} // lib.lists.foldr (i: cs: cs // { "*color${toString i}" = builtins.elemAt colourPalette i; }) {} (lib.lists.range 0 15);
} // listToAttrs (imap0 (i: c: nameValuePair "*color${toString i}" c) colourPalette);
}

View File

@@ -12,8 +12,7 @@ let
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
-d chat_id="${chatId}" \
-d text="$QUOTE" ${
if bot.parseMode == null then ""
else "-d parse_mode=${bot.parseMode}"
lib.strings.optionalString (bot.parseMode != null) "-d parse_mode=${bot.parseMode}"
}
'') bot.chatIds);
};