nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

slack-term.nix (1162B)


      1 {
      2   config,
      3   lib,
      4   pkgs,
      5   ...
      6 }:
      7 
      8 with lib;
      9 let
     10   cfg = config.programs.slack-term;
     11 in
     12 {
     13   meta.maintainers = [ maintainers.sikmir ];
     14 
     15   options.programs.slack-term = {
     16     enable = mkEnableOption "Slack client for your terminal";
     17 
     18     package = mkOption {
     19       default = pkgs.slack-term;
     20       defaultText = literalExpression "pkgs.slack-term";
     21       description = "slack-term package to install.";
     22       type = types.package;
     23     };
     24 
     25     token = mkOption {
     26       description = "Slack token.";
     27       type = types.str;
     28     };
     29   };
     30 
     31   config = mkIf cfg.enable {
     32     home.packages = [ cfg.package ];
     33 
     34     home.file.".slack-term".text = ''
     35       {
     36         "slack_token": "${cfg.token}",
     37         "sidebar_width": 2,
     38         "notify": "mention",
     39         "emoji": true,
     40         "theme": {
     41           "message": {
     42             "time_format": "02/01 15:04",
     43             "time": "fg-green,fg-bold",
     44             "name": "colorize,fg-bold",
     45             "text": "fg-white"
     46           },
     47           "channel": {
     48             "prefix": "fg-red,fg-bold",
     49             "icon": "fg-green,fg-bold",
     50             "text": "fg-blue,fg-bold"
     51           }
     52         }
     53       }
     54     '';
     55   };
     56 }